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

Function subscribe

packages/dev/s2-docs/src/Router.tsx:19–24  ·  view source on GitHub ↗
(callback: () => void)

Source from the content-addressed store, hash-verified

17};
18
19export function subscribe(callback: () => void) {
20 listeners.add(callback);
21 return () => {
22 listeners.delete(callback);
23 };
24}
25
26export function getSnapshot() {
27 if (cachedSnapshot.promise !== navigationPromise || cachedSnapshot.pathname !== targetPathname) {

Callers 2

useDelayedSnapshotFunction · 0.70
usePendingPageFunction · 0.70

Calls 2

deleteMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected