README in progress...come back another time to lay eyes on the most beautiful documentation you've ever seen! 😍
In the meantime,
check out the docs!
🚀
Or, see how to contribute. 💙
Installation 💾
Easy peazy, just $ npm install --save async-af
, right?
⚠️ Not so fast; there's actually several ways to include AsyncAF in your project/production site from easy to more complex:
Easy 👍
🔹 npm: $ npm install --save async-af
🔸 yarn: $ yarn add async-af
🔹 bower: async-af
is no longer published to bower. To continue using it with bower, look into <a href=https://github.com/mjeanroy/bower-npm-resolver>bower-npm-resolver
.
🔸 cdn: See the table for which script tag to use:
mode | browsers | script tag |
---|
development | modern (ES6+) | <script src="https://unpkg.com/async-af/index.js"></script> |
development | legacy (ES5+) | <script src="https://unpkg.com/async-af/legacy/index.js"></script> |
production | modern (ES6+) | <script src="https://unpkg.com/async-af/min.js"></script> |
production | legacy (ES5+) | <script src="https://unpkg.com/async-af/legacy/min.js"></script> |
More Complex 🤔
🔹 scoped packages:
Instead of pulling in the entire AsyncAF library, you can install smaller standalone packages for each of the AsyncAF methods you intend to use; for example, @async-af/map
and/or @async-af/filter
; see further instructions in the documentation for AsyncAfWrapper and AsyncAfWrapper.use.
🔸 scoped packages + babel-plugin-transform-imports
:
If you use more than a few AsyncAF scoped packages in a file, you might start to build a wall of import
statements to pull them all in. If this is an eyesore for you, look into babel-plugin-transform-imports
and condense that ugly wall down to a single import
statement! See Wrapper/Use: Too Many 🤬 Imports!? for a tutorial.
🔹 es modules:
AsyncAF as well as its scoped packages are also published as es modules. This gives an opportunity to conditionally load async-af
with ES6+ features in modern browsers and async-af
with ES5-compatible features in legacy browsers.
Using the cdn scripts as an example:
<script type="module" src="https://unpkg.com/async-af/esm/index.js"></script>
<script nomodule src="https://unpkg.com/async-af/legacy/index.js"></script>
or minimized for production:
<script type="module" src="https://unpkg.com/async-af/esm/min.js"></script>
<script nomodule src="https://unpkg.com/async-af/legacy/min.js"></script>
The script with <script type="module">
will load in any browser capable of loading es modules, while the script with <script nomodule>
will act as a fallback for legacy browsers.
See here and here for further reading on this strategy.
License
AsyncAF is licensed under the MIT License, so you can pretty much use it however you want
(but click here or here to get into specifics).