immutable-component

2.1.1 • Public • Published

immutable-component

immutable-component to make state immutable

Usage

this.setState({
    'a.b': 1
})
// or 
this.setState(prevState => {
    prevState.a.b = 1
})
 
// Either return a new value *or* modify the draft
this.setState(prevState => {
    // prevState.a.b.c = 1
    return { a: { b: 1 } }
})

Readme

Keywords

Package Sidebar

Install

npm i immutable-component

Weekly Downloads

1

Version

2.1.1

License

MIT

Unpacked Size

14.2 kB

Total Files

9

Last publish

Collaborators

  • ustccjw