Package Exports
- promisescript
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (promisescript) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Promise Script
A promise for loading client-side scripts asynchronously.
Install
npm install promisescript[Contrived] Example
var promisescript = require('promisescript');
function loadFacebook() {
return promisescript('https://connect.facebook.net/en_US/all.js').then(function() {
appId: 'YOUR_APP_ID',
channelUrl: '//github.com/terinjokes/promisescript'
});
}
loadFacebook.then(function() {
FB.XFBML.parse();
});Notes
- If you make multiple requests to the same URL, it will only be fetched once and the same promise will be returned.
- The promises returned by this module are pretty barebone, and you may wish to coerce it into a promise of your favorite library.
License
MIT