redux-persist-restful-storage

1.0.8 • Public • Published

Redux persist RESTful storage

use RESTful way to build a storage adaptor for redux-persist by implementing methods: setItem, getItem, removeItem and getAllKeys

install

npm install --save redux-persist-restful-storage

usage

import { AsyncRESTfulStorage } from 'redux-persist-restful-storage'
import { persistStore, autoRehydrate } from 'redux-persist'
const store = createStore(reducer, undefined, autoRehydrate())
persistStore(store, { storage: new AsyncRESTfulStorage() })

example

You need to build your own RESTful API server to communicate with redux-persist.

/example present an example with nodeJS. Use express to create a HTTP server and node-localstorage to save/get data.

To run with

npm init
npm install body-parser express node-localstorage
node nodeApiExample.js

Readme

Keywords

Package Sidebar

Install

npm i redux-persist-restful-storage

Weekly Downloads

0

Version

1.0.8

License

ISC

Last publish

Collaborators

  • jimmy_0435