Generates a signal using sessionStorage as the store. A shared Map is used if session storage is not supported.
The type of the value that should be stored and deserialized.
the initial value for the signal
the key to use in sessionStorage
optional options to configure the signal and underlying storage.
the writable signal generated from storageSignal.
const signal1 = sessionStorageSignal(1, 'someKey');console.log(signal1()); // This MIGHT not be 1 depending on what was stored in sessionStorage for "someKey".signal1.set(100);console.log(signal1()); // 100 ("someKey" is now 100 in sessionStorage) Copy
const signal1 = sessionStorageSignal(1, 'someKey');console.log(signal1()); // This MIGHT not be 1 depending on what was stored in sessionStorage for "someKey".signal1.set(100);console.log(signal1()); // 100 ("someKey" is now 100 in sessionStorage)
storageSignal
Generates a signal using sessionStorage as the store. A shared Map is used if session storage is not supported.