react-lowdb

1.2.0 • Public • Published

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

Package Sidebar

Install

npm i react-lowdb

Weekly Downloads

3

Version

1.2.0

License

MIT

Unpacked Size

9.94 kB

Total Files

5

Last publish

Collaborators

  • polats