diff options
| author | Sebastian <sebasjm@gmail.com> | 2023-05-29 14:53:36 -0300 |
|---|---|---|
| committer | Sebastian <sebasjm@gmail.com> | 2023-05-29 14:53:36 -0300 |
| commit | cb720b7a965ff20c5e857f8f84e958eadf50794e (patch) | |
| tree | 1685c40c4093b9be004012947ec3c4d35bacf73e | |
| parent | be9d3dad83801806c9a7d99c925aa2b86571a70b (diff) | |
if type is not string, then codec is mandatory
| -rw-r--r-- | packages/web-util/src/hooks/useLocalStorage.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/web-util/src/hooks/useLocalStorage.ts b/packages/web-util/src/hooks/useLocalStorage.ts index f6241f427..fae5537a4 100644 --- a/packages/web-util/src/hooks/useLocalStorage.ts +++ b/packages/web-util/src/hooks/useLocalStorage.ts @@ -36,6 +36,11 @@ export type StorageKey<Key> = { codec: Codec<Key>; }; +export function buildStorageKey<Key>( + name: string, + codec: Codec<Key>, +): StorageKey<Key>; +export function buildStorageKey(name: string): StorageKey<string>; export function buildStorageKey<Key = string>( name: string, codec?: Codec<Key>, |
