hoodiehq / pouchdb-hoodie-api

:dog: Hoodie-like API for PouchDB
https://hoodiehq.github.io/pouchdb-hoodie-api
Apache License 2.0
44 stars 11 forks source link

Challange: use PouchDB changes feed for events again #93

Open gr2m opened 8 years ago

gr2m commented 8 years ago

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