Skip to content

Commit 42a926b

Browse files
fix(utils): allow undefined for atomWithStorage subscriber return (#3055)
Co-authored-by: Daishi Kato <[email protected]>
1 parent ce38d68 commit 42a926b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vanilla/utils/atomWithStorage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ type Subscribe<Value> = (
1111
key: string,
1212
callback: (value: Value) => void,
1313
initialValue: Value,
14-
) => Unsubscribe
14+
) => Unsubscribe | undefined
1515

1616
type StringSubscribe = (
1717
key: string,
1818
callback: (value: string | null) => void,
19-
) => Unsubscribe
19+
) => Unsubscribe | undefined
2020

2121
type SetStateActionWithReset<Value> =
2222
| Value

0 commit comments

Comments
 (0)