Internal package
Deep proxies an object so it is only updateable through an update callback. outside an updater, it is impossible to make changes
It only proxies simple objects (not maps or sets) and arrays
It doesnt create new references and doesnt copy over anything
Original object is changed!
The best place to get started is at our: React-Uploady Documentation Website
#Yarn:
$ yarn add @rpldy/simple-state
#NPM:
$ npm i @rpldy/simple-state
All exports of this package are considered internal API and may change/disappear in any version: patch/minor/major
import createState from "@rpldy/simple-state"
const { state, update } = createState({
arr: [1,2,3]
});
state.arr.push(4);
console.log(state.arr); // print [1,2,3]
update((state) => {
state.arr.push(4);
});
console.log(state.arr); // print [1,2,3,4]