MCPcopy
hub / github.com/angular-ui/ui-router / cacheState

Function cacheState

test/angular/1.5/angular.js:6206–6216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6204 // This variable should be used *only* inside the cacheState function.
6205 var lastCachedState = null;
6206 function cacheState() {
6207 // This should be the only place in $browser where `history.state` is read.
6208 cachedState = getCurrentState();
6209 cachedState = isUndefined(cachedState) ? null : cachedState;
6210
6211 // Prevent callbacks fo fire twice if both hashchange & popstate were fired.
6212 if (equals(cachedState, lastCachedState)) {
6213 cachedState = lastCachedState;
6214 }
6215 lastCachedState = cachedState;
6216 }
6217
6218 function fireUrlChange() {
6219 if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {

Callers 2

BrowserFunction · 0.70

Calls 3

isUndefinedFunction · 0.70
equalsFunction · 0.70
getCurrentStateFunction · 0.50

Tested by

no test coverage detected