Skip to content

Commit

Permalink
feat: react binding to new api
Browse files Browse the repository at this point in the history
  • Loading branch information
eddort committed Aug 25, 2021
1 parent 3390755 commit 6cf5334
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/index.js
Expand Up @@ -5,7 +5,7 @@ export const useStore = (store, selector) => {
let [, force] = useState({})
useEffect(() => {
let cb = () => unstable_batchedUpdates(() => force({}))
return store._run ? store.listen(cb) : store.listen(selector, cb)
return store._run ? store.listen(cb) : store.watch(selector, cb)
}, [selector, store])
return store.get(selector)
}

0 comments on commit 6cf5334

Please sign in to comment.