zoepage / pouchdb-hoodie-unsynced-local-docs

check if local DB has unsynced changes
4 stars 5 forks source link

refactor: Unsynced local docs #6

Closed zoepage closed 9 years ago

gr2m commented 9 years ago

@zoepage let me know if my comment here doesn't make sense to you: https://github.com/hoodiehq/pouchdb-hoodie-unsynced-local-docs/pull/6#discussion_r34170201

We need a lot more refactoring because of this, the implementation & tests are still testing as if we'd do this:

var db = new PouchDB('dbname')
var api = db.unsyncedLocalDocs({remote: 'http://example.com/mydb'})

api.unsyncedLocalDocs()
.then(function(changes) {
  // changes is array of docs?
})

But instead it's now

var db = new PouchDB('dbname')

db.unsyncedLocalDocs({remote: 'http://example.com/mydb'})
.then(function(docs) { ... })
zoepage commented 9 years ago

@gr2m I had to give it a thought. As it's an internal method now, it makes sense. Will refactor today.

zoepage commented 9 years ago

refactor done by c2f69c3 and 05fc61f cc @gr2m

zoepage commented 9 years ago

Last comment on your PR @gr2m. If it's okay, I'll finish the README and we're good.

gr2m commented 9 years ago

merged via 76a7df6 :tada:

zoepage commented 9 years ago

we can close this, right?

gr2m commented 9 years ago

jup, sorry :)