Skip to content

Commit 20d1d1a

Browse files
committed
fix: use-local-storage-store to use any args for using it.
1 parent 876479f commit 20d1d1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/use-local-storage/use-local-storage-store.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ./create-storage.ts
22

33
import { createEffect, onCleanup, onMount } from 'solid-js';
4-
import { createStore, reconcile, StoreSetter, unwrap } from 'solid-js/store';
4+
import { createStore, reconcile, SetStoreFunction, unwrap } from 'solid-js/store';
55
import {
66
_createStorageHandler,
77
_deserializeJSON,
@@ -50,8 +50,8 @@ export function createStorageStore<T extends Object>(type: StorageType, hookName
5050

5151
const [value, setValue] = createStore<T>(readStorageValue(getInitialValueInEffect));
5252

53-
const setStorageValue = (setter: StoreSetter<T>) => {
54-
setValue(setter);
53+
const setStorageValue: SetStoreFunction<T> = (...args: any[]) => {
54+
setValue(...(args as [any]));
5555

5656
const val = unwrap(value);
5757
setItem(key, serialize(val));

0 commit comments

Comments
 (0)