You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constglobals=require('can-globals');// Set the global key's default value to the window objectglobals.initialize('global',window);
Setting a dynamic Property
constglobals=require('can-globals');// To make the value dynamic you can set it to a functionglobals.initialize("isRoot",function(){returnwindow.location.pathname==="/";});
Cached dynamic Property
constglobals=require('can-globals');// A third argument of true is passed to enable caching// The function is called once and the returned value is cached for the next useglobals.initialize("isWebkit",function(){vardiv=document.createElement("div");return"WebkitTransition"indiv.style;},true);
constglobals=require('can-globals');globals.initialize('global',window);// Overwrite global with an empty objectglobals.global={};// Restore to defaultdeleteglobals.global;