MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / historyDirection

Method historyDirection

core/src/components/router/router.tsx:233–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231 }
232
233 private historyDirection() {
234 const win = window;
235
236 if (win.history.state === null) {
237 this.state++;
238 win.history.replaceState(this.state, win.document.title, win.document.location?.href);
239 }
240
241 const state = win.history.state;
242 const lastState = this.lastState;
243 this.lastState = state;
244
245 if (state > lastState || (state >= lastState && lastState > 0)) {
246 return ROUTER_INTENT_FORWARD;
247 }
248 if (state < lastState) {
249 return ROUTER_INTENT_BACK;
250 }
251 return ROUTER_INTENT_NONE;
252 }
253
254 private async writeNavStateRoot(
255 segments: string[] | null,

Callers 1

onPopStateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected