Skip to content

Instantly share code, notes, and snippets.

@stormwild
Created January 12, 2013 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stormwild/4518390 to your computer and use it in GitHub Desktop.
Save stormwild/4518390 to your computer and use it in GitHub Desktop.
http://www.impressivewebs.com/my-current-javascript-design-pattern/#comment-32835
(function ($, App, window) {
'use strict';
var ready = false,
handler = function (e) {
},
init = function (page) {
if (ready) return;
// init stuff
$('.el').on('click', handler);
ready = true;
};
App.Subscribe('app/ready', init);
}(jQuery, App, this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment