navigation_helpers.ts

Declarations
#

view source

goto_unless_current
#

navigation_helpers.ts view source

(path: string | URL, options?: { replaceState?: boolean | undefined; noScroll?: boolean | undefined; keepFocus?: boolean | undefined; invalidateAll?: boolean | undefined; invalidate?: (string | ... 1 more ... | ((url: URL) => boolean))[] | undefined; state?: PageState | undefined; } | undefined): Promise<...>

Navigate to a path only if we're not already on that path. This avoids unnecessary navigation history changes when already at the destination.

path

type string | URL

options?

type { replaceState?: boolean | undefined; noScroll?: boolean | undefined; keepFocus?: boolean | undefined; invalidateAll?: boolean | undefined; invalidate?: (string | URL | ((url: URL) => boolean))[] | undefined; state?: PageState | undefined; } | undefined
optional

returns

Promise<void>

Imported by
#