Last active
November 15, 2016 13:51
-
-
Save davearel/9254418 to your computer and use it in GitHub Desktop.
jQuery AMD example, regarding: https://tech.bellycard.com/blog/the-future-of-jquery/
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
define([ | |
// jquery core is always required | |
'jquery/core', | |
// jquery utilities | |
'jquery/ajax', | |
'jquery/data' | |
], function(jq, ajax, data) { | |
// Using the core module, create a jQuery instance | |
// with the required extensions | |
var $ = jq.require(ajax, data); | |
// The local instance of $ contains the necessary jQuery | |
// extensions, but once this module is done executing, | |
// "$" no longer exists to other modules. | |
}); |
I agree with @visionmedia's point, but I don't see that happening.
Conversation has migrated to: https://gist.github.com/tbranyen/9255362
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@dmethvin, I think @davearel has a point. There is nothing stopping us from still having shared state amongst instances which all have different external Apis based on need.