Last active
February 11, 2024 20:32
-
-
Save dutchcelt/e7605c31ae32ddac868c to your computer and use it in GitHub Desktop.
AMD module
This file contains hidden or 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
| /** | |
| * 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