zoepage / pouchdb-hoodie-unsynced-local-docs

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

can we find a clearer name than `api.getLocalChanges()`? #4

Closed gr2m closed 9 years ago

gr2m commented 9 years ago

our API returns an array of documents that have changed locally and not yet replicated to remote. But somehow our current API reads like it would return the delta changes that have not been synced, instead of the entire documents:

api.getLocalChanges()
.then(function(changes) {
  // what is changes here?
})

I wonder if we could make it more clear that the API returns an array of changes instead of just docs, like

api.getLocallyChangedDocs()
.then(function(changedDocs) {
  // array of docs with local changes
})

Another idea would be to make an API that behaves similar to db.changes(), like

db.localChanges({
  remote: 'remoteDb',
  include_docs: true,
  // etc
})

but that feels like to low level.

Naming things is hard™ – any thoughts?

zoepage commented 9 years ago

thank you! pushed everything to PR #6

gr2m commented 9 years ago

done #6 ^5 all