https://github.com/btmpl/yaasync
Yet Another Async Loader
https://github.com/btmpl/yaasync
Last synced: 12 months ago
JSON representation
Yet Another Async Loader
- Host: GitHub
- URL: https://github.com/btmpl/yaasync
- Owner: BTMPL
- License: mit
- Created: 2015-11-06T19:28:05.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-09T05:18:21.000Z (over 10 years ago)
- Last Synced: 2025-03-24T02:47:40.866Z (over 1 year ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Synopsis
yaasync loader or "Yet Another Async" loader is a simple library that will let you load and call your JS synchronically depending on conditions you speciffy. It's a *simple* alternative to using big libraries such as [head.js](http://headjs.com/)
## Code Example
You need to load yaasync.js synchronically or wrap your binding in window.onload. After you've loaded the library you can make calls to `yaasync.assert`:
yasstnc.assert(condition, callback)
example:
yaasync.assert('jQuery', function() {
jQuery('#log').html('jQuery was succesfully loaded')
});
`condition` can be either an anonymous function (that will evaluate to `true` once the conditions are met) or string containing the variable name. In case you're using the string option, the variable must be globaly visible as `window.variable`
## License
A short snippet describing the license (MIT, Apache, etc.)