Skip to content

Instantly share code, notes, and snippets.

@yeebus
Last active April 26, 2017 15:43
Show Gist options
  • Save yeebus/a9b916fb4d5083f40ca7bddd5540698b to your computer and use it in GitHub Desktop.
Save yeebus/a9b916fb4d5083f40ca7bddd5540698b to your computer and use it in GitHub Desktop.
;(function($){
// NOTE: Event queue
__e = window.__e || [];
var feature = {
init:function(){
// Code here
}
};
/* 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