Skip to content

Commit

Permalink
return when falsy
Browse files Browse the repository at this point in the history
Co-authored-by: Shu Ding <g@shud.in>
  • Loading branch information
huozhi and shuding committed May 20, 2022
1 parent beaf868 commit 20fe03f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions subscription/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const subscription = (<Data, Error>(useSWRNext: SWRHook) =>
})

useIsomorphicLayoutEffect(() => {
if (!key) return
subscriptions.set(key, (subscriptions.get(key) || 0) + 1)

const onData = (val?: Data) => swr.mutate(val, false)
Expand Down

0 comments on commit 20fe03f

Please sign in to comment.