Skip to content

Instantly share code, notes, and snippets.

@WesSouza
Created September 29, 2014 18:54
Show Gist options
  • Save WesSouza/98f61f7d33cd3818b32e to your computer and use it in GitHub Desktop.
Save WesSouza/98f61f7d33cd3818b32e to your computer and use it in GitHub Desktop.
Require/define, min.
;(function(where){
var defined={},required={};
function define(thing,something){
defined[thing]=something
}
function require(thing){
required[thing]=required[thing]||defined[thing]()
return required[thing]
}
where.define=define
where.require=require;
})(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment