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

Function write

src/utils/favorites.js:13–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11};
12
13const write = list => {
14 try {
15 localStorage.setItem(STORAGE_KEY, JSON.stringify(list));
16
17 try {
18 window.dispatchEvent(new CustomEvent('favorites:updated', { detail: list }));
19 } catch {
20 // no-op
21 }
22 } catch {
23 // no-op
24 }
25};
26
27export const getSavedComponents = () => read();
28

Callers 3

addSavedComponentFunction · 0.70
removeSavedComponentFunction · 0.70
toggleSavedComponentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected