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

Challange: use PouchDB changes feed for events again #93

Open
5 of 6 tasks
gr2m opened this issue Dec 19, 2015 · 0 comments
Open
5 of 6 tasks

Challange: use PouchDB changes feed for events again #93

gr2m opened this issue Dec 19, 2015 · 0 comments
Labels

Comments

@gr2m
Copy link
Member

gr2m commented Dec 19, 2015

We once had a very simple, beautiful solution for events in pouchdb-hoodie-api: we started listening to PouchDB’s changes feed and used that to emit add, update and change events. But then we hit #54 which caused a timing issue, and after trying for a while to work around the problem while still using the changes feed, we eventually gave up. Instead of listening to the changes feed, we wrap all our methods and emit events manually, see changes here: https://github.com/hoodiehq/pouchdb-hoodie-api/pull/56/files

But I feel there is a better way, and it’s worth looking for it, it would remove a lot of complexity. And whoever finds a solution for this, gets a special Hoodie treat that I’ll have to make up first, but I promise it will be something nice <3

I’d suggest the following steps to get this started

  • start a PR 🎬
  • Create a failing test and make it the only one that runs using test.only. Use only PouchDB & EventEmitter to reproduce the problem mentioned in trigger events before methods resolve #54. 🔴
  • Find a solution 💚
  • Adjust the failing test to use pouchdb-hoodie-api APIs (see example in trigger events before methods resolve #54) 👍 no longer relevant, the synchronous .hasLocalChanges() API has been removed
  • Incorporate the solution, make sure all tests pass 👏
  • Review and merge 🙇
@gr2m gr2m added the ready label Dec 19, 2015
@gr2m gr2m self-assigned this Feb 21, 2017
@gr2m gr2m removed their assignment Sep 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant