Skip to content

Instantly share code, notes, and snippets.

@dutchcelt
Last active February 11, 2024 20:32
Show Gist options
  • Select an option

  • Save dutchcelt/e7605c31ae32ddac868c to your computer and use it in GitHub Desktop.

Select an option

Save dutchcelt/e7605c31ae32ddac868c to your computer and use it in GitHub Desktop.
AMD module
/**
* AMD module
*/
!function( name, factory ){
if ( typeof define == 'function' && typeof define.amd == 'object' ) {
// Add dependencies here
define([ 'jquery', 'dutchcelt/Dater' ], factory);
} else {
// Not called as an AMD module?
// Add the factory to the global scope.
window[name] = factory();
}
}('test', function(){
"use strict";
if( 'querySelector' in document && 'localStorage' in window && 'addEventListener' in window ) {
console.log($().jquery);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment