Skip to content

Commit

Permalink
refactor(atom-with-broadcast): put types in update
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangvu12 committed Aug 28, 2024
1 parent 906ad02 commit 3dafee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/recipes/atom-with-broadcast.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export function atomWithBroadcast<Value>(key: string, initialValue: Value) {
}
}

const returnedAtom = atom<Value, [SetStateAction<Value>], void>(
const returnedAtom = atom(
(get) => get(broadcastAtom),
(_get, set, update) => {
(_get, set, update: SetStateAction<Value>) => {
set(broadcastAtom, { isEvent: false, value: update })
},
)
Expand Down

0 comments on commit 3dafee2

Please sign in to comment.