MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / cacheState

Function cacheState

web/static/bower_components/angular/angular.js:5666–5676  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5664 // This variable should be used *only* inside the cacheState function.
5665 var lastCachedState = null;
5666 function cacheState() {
5667 // This should be the only place in $browser where `history.state` is read.
5668 cachedState = getCurrentState();
5669 cachedState = isUndefined(cachedState) ? null : cachedState;
5670
5671 // Prevent callbacks fo fire twice if both hashchange & popstate were fired.
5672 if (equals(cachedState, lastCachedState)) {
5673 cachedState = lastCachedState;
5674 }
5675 lastCachedState = cachedState;
5676 }
5677
5678 function fireUrlChange() {
5679 if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {

Callers 2

BrowserFunction · 0.85

Calls 3

getCurrentStateFunction · 0.85
isUndefinedFunction · 0.85
equalsFunction · 0.85

Tested by

no test coverage detected