missing key subscription
This commit is contained in:
parent
aba173d8a9
commit
84d4e68ab7
@ -106,7 +106,7 @@ export function useLocalStorage<Type = string>(
|
|||||||
const newValue = storage.get(key.id);
|
const newValue = storage.get(key.id);
|
||||||
setStoredValue(convert(newValue));
|
setStoredValue(convert(newValue));
|
||||||
});
|
});
|
||||||
}, []);
|
}, [key.id]);
|
||||||
|
|
||||||
const setValue = (value?: Type): void => {
|
const setValue = (value?: Type): void => {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
|
@ -51,7 +51,7 @@ export function useMemoryStorage<Type = string>(
|
|||||||
const newValue = storage.get(key);
|
const newValue = storage.get(key);
|
||||||
setStoredValue(newValue === undefined ? defaultValue : newValue);
|
setStoredValue(newValue === undefined ? defaultValue : newValue);
|
||||||
});
|
});
|
||||||
}, []);
|
}, [key]);
|
||||||
|
|
||||||
const setValue = (value?: Type): void => {
|
const setValue = (value?: Type): void => {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
|
Loading…
Reference in New Issue
Block a user