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

Method constructor

packages/dev/s2-docs/src/useLocalStorage.ts:17–21  ·  view source on GitHub ↗
(key: string, defaultValue: string)

Source from the content-addressed store, hash-verified

15 subscriptions: Set<() => void>;
16
17 constructor(key: string, defaultValue: string) {
18 this.key = 's2.' + key;
19 this.defaultValue = defaultValue;
20 this.subscriptions = new Set();
21 }
22
23 subscribe = (fn: () => void) => {
24 if (!this.key) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected