Skip to content

Commit

Permalink
fix: add parentheses to catch
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhhashemi authored Feb 25, 2024
1 parent 001ef6f commit b865bda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vanilla/utils/atomWithStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function createJSONStorage<Value>(
if (lastStr !== str) {
try {
lastValue = JSON.parse(str, options?.reviver)
} catch {
} catch (_e) {
return initialValue
}
lastStr = str
Expand Down Expand Up @@ -155,7 +155,7 @@ export function createJSONStorage<Value>(
let newValue: Value
try {
newValue = JSON.parse(e.newValue || '')
} catch {
} catch (_e) {
newValue = initialValue
}
callback(newValue)
Expand Down

0 comments on commit b865bda

Please sign in to comment.