Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoteDB live replication not working #16

Open
brancooo1 opened this issue Apr 8, 2018 · 2 comments
Open

RemoteDB live replication not working #16

brancooo1 opened this issue Apr 8, 2018 · 2 comments

Comments

@brancooo1
Copy link

brancooo1 commented Apr 8, 2018

First of all thank you for the great work!

I've been using redux-pouchdb without any problems, but the reinit() was required so I switched to your library. The app is working, the changes are replicating to the server CouchDB. Changes comes to the client device, but the store is not updated by your library. Is this a known issue, or am I doing something wrong?

Thank you for advices!

export default function configureStore() {
  const localDB = new PouchDB('test');
  const remoteDB = new PouchDB('http://192.168.0.87:5984/test');
  const sync = PouchDB.sync(localDB, remoteDB, {live: true, retry: true})
     .on('change', function (info) {
          alert('change');
      })
  
  const applyMiddlewares = applyMiddleware(
    ReduxThunk
  );
  
  const createStoreWithMiddleware = compose(
    persistentStore({db: localDB}),
    applyMiddlewares
  )(createStore);
  
  const store = createStoreWithMiddleware(reducers, {});

  return store;
}

something tells me, it can be in reducers:

export default combineReducers({
  app: AppReducer,

  places: persistentReducer(PlaceReducer, {name: 'Place'}),
  categories: persistentReducer(CategoryReducer, {name: 'Category'}),
  items: persistentReducer(ItemReducer, {name: 'Item'}),
  customers: persistentReducer(CustomerReducer, {name: 'Customer'}),
  orders: persistentReducer(OrderReducer, {name: 'Order'}),
});

This warning is thrown 5 times (for every reducer)
screenshot_20180408-191533

@brancooo1
Copy link
Author

Adding import 'babel-polyfill' to the library or to the index.js of the app solves the issue.

I think you should add the dependency, if you use the Symbol

@medihack
Copy link
Owner

medihack commented Jun 15, 2018

@brancooo1 What Symbol do you mean exactly? When I search through the code I don't see any Symbol mentioned :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants