Skip to content

Instantly share code, notes, and snippets.

@gmmorris
Created August 29, 2015 14:39
Show Gist options
  • Save gmmorris/5aa1d72f823df7807bf4 to your computer and use it in GitHub Desktop.
Save gmmorris/5aa1d72f823df7807bf4 to your computer and use it in GitHub Desktop.
Gists for my article on the LH rewrite
var StateController = new function(){
this.GetState = function(){
$(document).trigger('navestate:giveMeTheState',this)
};
this.hereYouGo = function(navState){
// Do something with navState
};
};
var NavState = new function(){
var myNaveState = { nav : 'state' };
$(document).on('navestate:giveMeTheState',function(e, giveItTo){
giveItTo.hereYouGo(myNaveState);
});
};
StateController.GetState();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment