MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / onStorage

Function onStorage

src/components/navs/Sidebar.jsx:54–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 useEffect(() => {
53 const updateSaved = () => setSavedSet(new Set(getSavedComponents()));
54 const onStorage = e => {
55 if (!e || e.key === 'savedComponents') updateSaved();
56 };
57
58 window.addEventListener('favorites:updated', updateSaved);
59 window.addEventListener('storage', onStorage);

Callers

nothing calls this directly

Calls 1

updateSavedFunction · 0.85

Tested by

no test coverage detected