Created
September 21, 2015 21:39
-
-
Save tmcw/ca0ac50117ca8a01a1fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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