Skip to content

Commit

Permalink
fix: useStorage setItem (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored Jul 24, 2020
1 parent 1d11476 commit 11a28a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/fuselage-hooks/src/useStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const makeStorage = (
const setValue: Dispatch<SetStateAction<T>> = useCallback((value: T extends unknown ? SetStateAction<T> : never): void => {
setStoredValue((prevValue: T) => {
const valueToStore: T = typeof value === 'function' ? value(prevValue) : value;
storage.setItem(key, JSON.stringify(valueToStore));
storage.setItem(getKey(key), JSON.stringify(valueToStore));
return valueToStore;
});
}, [key]);
Expand Down

0 comments on commit 11a28a3

Please sign in to comment.