Skip to content

Instantly share code, notes, and snippets.

@paulmars
Created December 10, 2012 02:59
Show Gist options
  • Select an option

  • Save paulmars/4248095 to your computer and use it in GitHub Desktop.

Select an option

Save paulmars/4248095 to your computer and use it in GitHub Desktop.
JS Modules
(function () {
var server = false,
MyModels;
if (typeof exports !== 'undefined') {
MyModels = exports;
server = true;
} else {
MyModels = this.MyModels = {};
}
MyModels.AppModel...
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment