mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 17:46:39 -04:00
more caching and error handling
This commit is contained in:
@ -7,7 +7,6 @@ const useLocalStorage = <T = string>(
|
||||
key: string,
|
||||
initialValue?: T
|
||||
): [T | undefined, Dispatch<SetStateAction<T | undefined>>, () => void] => {
|
||||
// TODO: make these customizable (e.g. `JSON.stringify()` and `JSON.parse()`)
|
||||
const serializer = (value: T | undefined) => String(value);
|
||||
const deserializer = (value: string) => value as unknown as T;
|
||||
|
||||
|
Reference in New Issue
Block a user