diff --git a/package.json b/package.json index 7ac431e..756e847 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "form-data": "^2.3.2", "html-webpack-plugin": "^2.30.1", "linkedom": "0.14.21", + "localforage": "^1.10.0", "mocha": "^6.2.0", "node-sass": "^7.0.3", "react": "^16.9.0", diff --git a/src/index.js b/src/index.js index 8deae85..5fd3a20 100644 --- a/src/index.js +++ b/src/index.js @@ -10,7 +10,8 @@ import { createStore, applyMiddleware } from 'redux' import { routerMiddleware, ConnectedRouter, connectRouter } from 'connected-react-router' import createHistory from 'history/createBrowserHistory' import { persistStore, persistCombineReducers } from 'redux-persist' -import storage from 'redux-persist/es/storage' +/* import storage from 'redux-persist/es/storage' */ +import localForage from './localForageConfig' import { PersistGate } from 'redux-persist/es/integration/react' import reducers from './reducers' import App from './components/App' @@ -26,7 +27,7 @@ const history = createHistory({ basename }) const persistConf = { key: 'root', - storage, + storage: localForage, blacklist: ['router'] } diff --git a/src/localForageConfig.js b/src/localForageConfig.js new file mode 100644 index 0000000..82a1386 --- /dev/null +++ b/src/localForageConfig.js @@ -0,0 +1,10 @@ +import localForage from 'localforage' + +localForage.config({ + driver: localForage.INDEXEDDB, + name: 'romajs', + version: 1.0, + storeName: 'keyvaluepairs', +}) + +export default localForage