Skip to content

wgjtyu/redux-persist-weapp-storage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redux-persist-weapp-storage

A simple redux-persist storage engine for wechat mini program (微信小程序) Also support wepy

install

npm i redux-persist-weapp-storage

usage

just use redux-persist-weapp-storage as persist config storage option

// configureStore.js
import { createStore } from 'redux'
import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist-weapp-storage'

const rootPersistConfig = {
  key: 'root',
  storage
}

const persistedReducer = persistReducer(persistConfig, rootReducer)

export default () => {
  let store = createStore(persistedReducer)
  let persistor = persistStore(store)
  return { store, persistor }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%