Created
February 20, 2014 03:08
-
-
Save w33ble/9106423 to your computer and use it in GitHub Desktop.
cjs via require example
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
// 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