Omnistac / zedux

:zap: A Molecular State Engine for React
https://Omnistac.github.io/zedux/
MIT License
366 stars 7 forks source link

feat(react)!: useAtomConsumer -> useAtomContext #33

Closed bowheart closed 1 year ago

bowheart commented 1 year ago

Description

Zedux using the word Consumer instead of Context is an unnecessary discrepancy between Zedux's API and React's. Rename useAtomConsumer to useAtomContext.

Also update all docs and tests.

Breaking Change

This is a breaking change. Import and use useAtomContext instead of useAtomConsumer now:

- import { useAtomConsumer } from '@zedux/react' // before
+ import { useAtomContext } from '@zedux/react' // after

- const instance = useAtomConsumer(myAtom) // before
+ const instance = useAtomContext(myAtom) // after