Skip to content

Commit b865bda

Browse files
authored
fix: add parentheses to catch
1 parent 001ef6f commit b865bda

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
@@ -121,7 +121,7 @@ export function createJSONStorage<Value>(
121121
if (lastStr !== str) {
122122
try {
123123
lastValue = JSON.parse(str, options?.reviver)
124-
} catch {
124+
} catch (_e) {
125125
return initialValue
126126
}
127127
lastStr = str
@@ -155,7 +155,7 @@ export function createJSONStorage<Value>(
155155
let newValue: Value
156156
try {
157157
newValue = JSON.parse(e.newValue || '')
158-
} catch {
158+
} catch (_e) {
159159
newValue = initialValue
160160
}
161161
callback(newValue)

0 commit comments

Comments
 (0)