Created
May 29, 2019 12:58
-
-
Save daverivera/918a56225c9d4281bfacfb88efa75019 to your computer and use it in GitHub Desktop.
redux-crosstab_indexdb_index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { render } from 'react-dom' | |
-import { createStore } from 'redux' | |
+import { createStore, compose } from 'redux' | |
import { Provider } from 'react-redux' | |
import App from './components/App' | |
import reducer from './reducers' | |
import 'todomvc-app-css/index.css' | |
+import PouchDB from 'pouchdb' | |
+import { persistentStore } from 'redux-pouchdb'; | |
+const db = new PouchDB('todomvc'); | |
-const store = createStore(reducer) | |
+const store = createStore( | |
+ reducer, | |
+ compose(persistentStore(db)) | |
+); | |
render( | |
<Provider store={store}> | |
<App /> | |
</Provider>, | |
document.getElementById('root') | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment