missing key subscription

This commit is contained in:
Sebastian 2023-08-30 10:17:23 -03:00
parent aba173d8a9
commit 84d4e68ab7
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
2 changed files with 2 additions and 2 deletions

View File

@ -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) {

View File

@ -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) {