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

Function cacheState

test/angular/1.4/angular.js:5923–5933  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5921 // This variable should be used *only* inside the cacheState function.
5922 var lastCachedState = null;
5923 function cacheState() {
5924 // This should be the only place in $browser where `history.state` is read.
5925 cachedState = getCurrentState();
5926 cachedState = isUndefined(cachedState) ? null : cachedState;
5927
5928 // Prevent callbacks fo fire twice if both hashchange & popstate were fired.
5929 if (equals(cachedState, lastCachedState)) {
5930 cachedState = lastCachedState;
5931 }
5932 lastCachedState = cachedState;
5933 }
5934
5935 function fireUrlChange() {
5936 if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {

Callers 2

BrowserFunction · 0.70

Calls 3

getCurrentStateFunction · 0.70
isUndefinedFunction · 0.70
equalsFunction · 0.70

Tested by

no test coverage detected