Skip to content

Instantly share code, notes, and snippets.

@yeebus
Last active May 7, 2017 17:25
Show Gist options
  • Save yeebus/c2d7fa77fb4f499dc4695c5e64c2a95a to your computer and use it in GitHub Desktop.
Save yeebus/c2d7fa77fb4f499dc4695c5e64c2a95a to your computer and use it in GitHub Desktop.
;(function($){
// NOTE: Event queue
__e = window.__e || [];
function applyFeature(){
// My messy code as it exists right now!
}
/* 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', applyFeature]);
*/
if( wp_pb.StaticMethods.isPageHydrated() ){
applyFeature()
}
// NOTE: For PWA
__e.push(['shamble', function(){
applyFeature();
}]);
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment