Skip to content

trackkit / index / NavigationSource

Interface: NavigationSource

Defined in: types.ts:102

Abstraction for SPA/router navigation sources.

You can plug in your own router adapter (e.g. React Router, Vue Router) by implementing this interface and passing it via FacadeOptions.navigationSource.

Methods

subscribe()

subscribe(cb): () => void

Defined in: types.ts:110

Subscribe to normalised URL changes (pathname + search + hash).

The callback is invoked whenever the current logical page changes. Returns an unsubscribe function which should detach any listeners you register.

Parameters

cb

(url) => void

Returns

(): void

Returns

void

Released under the MIT License.