react-lowdb
v1.2.0
Published
Save React state on LocalStorage using lowdb
Downloads
4
Maintainers
Readme
react-lowdb
Save React state on LocalStorage using lowdb
Demo
Check it out on CodeSandbox
Installation
npm install react-lowdb
Usage
import ComponentWithReactLowdb from 'react-lowdb'
class Demo extends ComponentWithReactLowdb {
// All state changes from Demo will now be saved
// via ComponentWithReactLowdb's componentDidUpdate.
//
// They are loaded back via ComponentWithReactLowdb's
// componentDidMount.
}
Props
- defaultDBFields (Optional) - default values of the DB
- dbName (Optional) - specify the name of the node to save in LocalStorage. Defaults to [constructor.name]-react-lowdb
License
MIT © Paul Gadi