npm.io
1.2.0 • Published 7 years ago

react-lowdb

Licence
MIT
Version
1.2.0
Deps
5
Size
10 kB
Vulns
0
Weekly
0
Stars
3

react-lowdb

Save React state on LocalStorage using lowdb

Build Status dependencies Status devDependencies Status License: MIT

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

Keywords