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

Function cacheState

lib/test/angular/1.8.0/angular.js:6751–6763  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6749 // This variable should be used *only* inside the cacheState function.
6750 var lastCachedState = null;
6751 function cacheState() {
6752 // This should be the only place in $browser where `history.state` is read.
6753 cachedState = getCurrentState();
6754 cachedState = isUndefined(cachedState) ? null : cachedState;
6755
6756 // Prevent callbacks fo fire twice if both hashchange & popstate were fired.
6757 if (equals(cachedState, lastCachedState)) {
6758 cachedState = lastCachedState;
6759 }
6760
6761 lastCachedState = cachedState;
6762 lastHistoryState = cachedState;
6763 }
6764
6765 function fireStateOrUrlChange() {
6766 var prevLastHistoryState = lastHistoryState;

Callers 2

BrowserFunction · 0.70
fireStateOrUrlChangeFunction · 0.70

Calls 3

isUndefinedFunction · 0.70
equalsFunction · 0.70
getCurrentStateFunction · 0.50

Tested by

no test coverage detected