【文件属性】:
文件名称:redux-persist-mongodb-storage:使用Redux服务器端时redux-persist使用MongoDb的存储对象
文件大小:62KB
文件格式:ZIP
更新时间:2021-05-17 14:56:30
JavaScript
Redux Persist MongoDb存储
这是与一起使用的对象。 它符合当前的存储对象定义,因为它公开了以下方法:
getItem(key)
setItem(key, value)
removeItem(key)
目的是提供一个使用作为后备存储的服务器端存储对象。
用法
首先使用npm安装商店,例如:
npm install - S redux-persist-mongodb-storage
然后在您的代码中包含商店,例如在store.js :
import { createStore } from 'redux';
import { persistStore, persistReducer} from 'redux-persist';
import MongoDBStore from 'redux-persist-mongodb-storage';
import red
【文件预览】:
redux-persist-mongodb-storage-master
----.gitignore(272B)
----test()
--------MongoDBStore.spec.js(2KB)
----LICENSE(1KB)
----package.json(738B)
----index.js(3KB)
----ReadMe.md(2KB)
----package-lock.json(266KB)