MCPcopy Create free account
hub / github.com/adobe/react-spectrum / setNavigationPromise

Function setNavigationPromise

packages/dev/s2-docs/src/Router.tsx:33–47  ·  view source on GitHub ↗
(promise: Promise<void> | null, pathname?: string)

Source from the content-addressed store, hash-verified

31}
32
33export function setNavigationPromise(promise: Promise<void> | null, pathname?: string) {
34 targetPathname = pathname || null;
35 navigationPromise = promise;
36
37 if (promise) {
38 promise.finally(() => {
39 if (navigationPromise === promise) {
40 navigationPromise = null;
41 listeners.forEach(callback => callback());
42 }
43 });
44 }
45
46 listeners.forEach(callback => callback());
47}
48
49export function getPageFromPathname(pages: Page[], url: string | null): Page | null {
50 if (!url) {

Callers 1

navigateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected