Omnistac / zedux

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

feat(react)!: AtomInstanceProvider -> AtomProvider #32

Closed bowheart closed 1 year ago

bowheart commented 1 year ago

Description

Since revising the concept of an "atom" in Zedux to mean "atom instance" instead of "atom template", the AtomInstanceProvider component is unnecessarily verbose. AtomProvider now means the same thing and looks so much cleaner.

We are keeping the word instance in most APIs to avoid confusion, but it isn't necessary here since AtomProvider has a required instance or instances prop.

Breaking Change

This is a breaking change - the component has been renamed. Import and use AtomProvider now:

- import { AtomInstanceProvider } from '@zedux/react' // before
+ import { AtomProvider } from '@zedux/react' // after

- <AtomInstanceProvider instance={instance}><Child /></AtomInstanceProvider> // before
+ <AtomProvider instance={instance}><Child /></AtomProvider> // after