1
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:
2025-03-24 11:45:48 -04:00
parent 8890c1d08d
commit d3250bd00e
18 changed files with 335 additions and 327 deletions

View File

@ -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;