Skip to content

Instantly share code, notes, and snippets.

@w33ble
Created February 20, 2014 03:08
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/9106423 to your computer and use it in GitHub Desktop.
Save w33ble/9106423 to your computer and use it in GitHub Desktop.
cjs via require example
// commonjs pattern
define(function(require) {
var $ = require('jquery');
// 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