Last active
April 26, 2017 15:50
-
-
Save yeebus/8eb900508f8aa2305ac95fdedbac9173 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(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