0.0.1-0 • Published 6 years ago

copy-on-write-store v0.0.1-0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

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-write

Usage

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,
});