copy-on-write-store
v0.0.1-0
Published
<div align="center"> <h1>react-copy-write</h1>
Readme
An immutable React state management library with a simple mutable API, memoized selectors, and structural sharing. Powered by Immer.
Installation
react-copy-write requires React 16.3 or later, as it depends on the new React.createContext API.
yarn add react-copy-writeUsage
react-copy-write exports a function which takes your base state and returns an object with the Provider and Consumer components, along with a few other utility methods.
import createState from 'react-copy-write'
const UserState = createState({
user: null,
loggedIn: false,
});