0.0.1-0 • Published 8 years ago
copy-on-write-store v0.0.1-0
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,
});0.0.1-0
8 years ago