Skip to content

Instantly share code, notes, and snippets.

@w33ble
Created February 20, 2014 03:11
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 w33ble/9106447 to your computer and use it in GitHub Desktop.
Save w33ble/9106447 to your computer and use it in GitHub Desktop.
sort of cleaner require example
// require pattern
var deps = [
'jquery',
'lodash',
'backbone'
];
define(deps, function($, _, Backbone) {
// Replaces the 'shorthand' function from the first example
// This is returned as a module to the require call
return {
show: function() {
$('.loading-overlay').removeClass('hidden');
},
hide: function() {
setTimeout( function() { $('.loading-overlay').addClass('hidden'); }, 1375 );
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment