Skip to content

jimmy0435/redux-persist-restful-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

restful storage for redux-persist

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published