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

Method onStorage

packages/dev/s2-docs/src/useLocalStorage.ts:28–32  ·  view source on GitHub ↗
(e: StorageEvent)

Source from the content-addressed store, hash-verified

26 }
27
28 let onStorage = (e: StorageEvent) => {
29 if (e.key === this.key) {
30 fn();
31 }
32 };
33
34 window.addEventListener('storage', onStorage);
35 return () => {

Callers

nothing calls this directly

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected