MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / cacheState

Function cacheState

code/songhop/www/lib/angular/angular.js:5078–5088  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5076 // This variable should be used *only* inside the cacheState function.
5077 var lastCachedState = null;
5078 function cacheState() {
5079 // This should be the only place in $browser where `history.state` is read.
5080 cachedState = window.history.state;
5081 cachedState = isUndefined(cachedState) ? null : cachedState;
5082
5083 // Prevent callbacks fo fire twice if both hashchange & popstate were fired.
5084 if (equals(cachedState, lastCachedState)) {
5085 cachedState = lastCachedState;
5086 }
5087 lastCachedState = cachedState;
5088 }
5089
5090 function fireUrlChange() {
5091 if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {

Callers 2

BrowserFunction · 0.70

Calls 2

isUndefinedFunction · 0.70
equalsFunction · 0.70

Tested by

no test coverage detected