MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / writeNavState

Method writeNavState

core/src/components/router/router.tsx:356–385  ·  view source on GitHub ↗
(
    node: HTMLElement | undefined,
    chain: RouteChain,
    direction: RouterDirection,
    segments: string[],
    redirectFrom: string[] | null,
    index = 0,
    animation?: AnimationBuilder
  )

Source from the content-addressed store, hash-verified

354 }
355
356 private async writeNavState(
357 node: HTMLElement | undefined,
358 chain: RouteChain,
359 direction: RouterDirection,
360 segments: string[],
361 redirectFrom: string[] | null,
362 index = 0,
363 animation?: AnimationBuilder
364 ): Promise<boolean> {
365 if (this.busy) {
366 printIonWarning('[ion-router] - Router is busy, transition was cancelled.');
367 return false;
368 }
369 this.busy = true;
370
371 // generate route event and emit will change
372 const routeEvent = this.routeChangeEvent(segments, redirectFrom);
373 if (routeEvent) {
374 this.ionRouteWillChange.emit(routeEvent);
375 }
376
377 const changed = await writeNavState(node, chain, direction, index, false, animation);
378 this.busy = false;
379
380 // emit did change
381 if (routeEvent) {
382 this.ionRouteDidChange.emit(routeEvent);
383 }
384 return changed;
385 }
386
387 private setSegments(segments: string[], direction: RouterDirection, queryString?: string, fragment?: string) {
388 this.state++;

Callers 1

safeWriteNavStateMethod · 0.95

Calls 3

routeChangeEventMethod · 0.95
printIonWarningFunction · 0.90
writeNavStateFunction · 0.90

Tested by

no test coverage detected