Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created September 21, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmcw/ca0ac50117ca8a01a1fd to your computer and use it in GitHub Desktop.
Save tmcw/ca0ac50117ca8a01a1fd to your computer and use it in GitHub Desktop.
var loadScript = require('load-script'),
R = require('ramda');
var getAWS = R.once(function() {
return new Promise(function(resolve, reject) {
if (typeof AWS !== 'undefined') {
return resolve(AWS);
}
loadScript('bundle-aws.min.js', function(err) {
if (err || typeof AWS === 'undefined') {
return reject(err || new Error('An error occurred'));
} else {
resolve(AWS);
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment