Skip to content

Instantly share code, notes, and snippets.

@karlwestin
Last active December 16, 2015 07:08
Show Gist options
  • Save karlwestin/5396117 to your computer and use it in GitHub Desktop.
Save karlwestin/5396117 to your computer and use it in GitHub Desktop.
console.log('bar.js is run (should run 2nd)');
define(['https://gist.github.com/karlwestin/5396117/raw/foo.js'], function () {
console.log('complete in bar.js is run (should run 4th)');
window.divide = function (a, b) {
return a / b;
}
});
// @see http://jsfiddle.net/YbBuG/
console.log('fiddle.js is run (should run 1st)');
define(['https://gist.github.com/karlwestin/5396117/raw/bar.js'], function () {
console.log('callback in fiddle.js is run (should run 5th)');
try {
divide(times(4, 6), 3);
}
catch (error) {
console.log(error);
}
});
console.log('foo.js is run (should run 3rd)');
window.times = function (a, b) {
return a * b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment