title: Redux store and PouchDB not syncing with redux-pouchdb
body: <p>I am trying to get my redux state to be synced to a PouchDB instance, but having trouble with this. </p>
  
  <p>As it seems in the logs, neither is my redux state synced to PouchDB after an action happened, nor is the PouchDB document synced to the redux state on update. </p>
  
  <p>I tried to implement <code>redux-pouchdb</code> as it is implemented in <a href="https://github.com/jrzerr/react-redux-pouchdb" rel="nofollow noreferrer">jrzerr/react-redux-pouchdb</a> but neither do I get an error, nor does the sync work.</p>
  
  <p>This is the code I am working with:</p>
  
  <p><em>Reducer (modules/mainbase.js):</em></p>
  
  <pre><code>import { persistentReducer } from 'redux-pouchdb';
  export const INPUT_CHANGED = 'mainbase/INPUT_CHANGED'
  
  const initialState = {}
  
  function mainbase (state = initialState, action) {
      switch (action.type) {
          case INPUT_CHANGED:
              state[action.key] = action.value;
              return {...state}
          default:
              return state;
      }
  }
  
  export default persistentReducer(mainbase);
  
  export const inputChanged = (key, value) =&gt; {
    return dispatch =&gt; {
      dispatch({
        type: INPUT_CHANGED,
        key: key,
        value: value
      })
    }
  }
  </code></pre>
  
  <p><em>Root reducer (modules/index.js):</em></p>
  
  <pre><code>import { combineReducers } from 'redux'
  import { routerReducer } from 'react-router-redux'
  import mainbase from './mainbase'
  
  export default combineReducers({
    router: routerReducer,
    mainbase
  })
  </code></pre>
  
  <p><em>Store (store.js):</em></p>
  
  <pre><code>import { createStore, applyMiddleware, compose } from 'redux'
  import { routerMiddleware } from 'react-router-redux'
  import thunk from 'redux-thunk'
  import createHistory from 'history/createBrowserHistory'
  import rootReducer from './modules'
  import { persistentStore } from 'redux-pouchdb'
  import PouchDB from 'pouchdb'
  
  export const history = createHistory()
  
  const db = new PouchDB('testproject')
  
  const initialState = {}
  
  const enhancers = [
    persistentStore(db)
  ]
  
  const middleware = [
    thunk,
    routerMiddleware(history)
  ]
  
  const composedEnhancers = compose(
    applyMiddleware(...middleware),
    ...enhancers
  )
  
  const store = createStore(
    rootReducer,
    initialState,
    composedEnhancers
  )
  
  export default store
  </code></pre>
  
  <p>I am grateful for any help.</p>