Skip to content

Instantly share code, notes, and snippets.

@yeebus
Last active April 26, 2017 15:50
Show Gist options
  • Save yeebus/8eb900508f8aa2305ac95fdedbac9173 to your computer and use it in GitHub Desktop.
Save yeebus/8eb900508f8aa2305ac95fdedbac9173 to your computer and use it in GitHub Desktop.
;(function($){
// NOTE: Event queue
__e = window.__e || [];
var feature = {
fn1:function(){
// Code here
},
fn2:function(){
// Code here
},
fn3:function(){
// Code here
},
init:function(){
this.fn1();
this.fn2();
this.fn3();
}
};
/* NOTE: Until all code is converted to use the event queue, this risks running in a different sequence than it currently does
__e.push(['dom-complete', function() {
if( wp_pb.StaticMethods.isPageHydrated() ){
feature.init();
}
}]);
*/
if( wp_pb.StaticMethods.isPageHydrated() ){
feature.init();
}
// NOTE: For PWA
__e.push(['shamble', function() {
feature.init();
}]);
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment