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

Allow using a pouchdb database per reducer. #28

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

fabioDMFerreira
Copy link

@fabioDMFerreira fabioDMFerreira commented Mar 10, 2020

Solves #27 .
After configuring more than one reducer with pouchdb, the library was loading the same reducer state in the multiple reducers configured with redux-pouchdb.

After configuring more than one reducer with pouchdb, the library was loading the same reducer state in the multiple reducers configured with redux-pouchdb
@fabioDMFerreira fabioDMFerreira changed the title #27 Allow using a pouchdb database per reducer. Allow using a pouchdb database per reducer. Mar 10, 2020
…ove performance.

* Only gets the pouchDB document that matters to the persistent reducer.

* Avoid setting reducer multiple times on initialization.
@fabioDMFerreira
Copy link
Author

The actual current version was creating an event listener per persistent reducer what was causing problems on reducers population. The issue was due to have many events listeners as I was receiving the next warning in the console.

"Warning: Possible EventEmitter memory leak detected. 11 destroyed listeners added. Use emitter.setMaxListeners() to increase limit"

The last commit changes the code to use the same event listener to populate the multiple persistent reducers.

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

Successfully merging this pull request may close these issues.

1 participant