MDSLKTR / pouch-vue

Pouchdb bindings for Vue.js
MIT License
90 stars 17 forks source link

More Api changes #20

Closed assemblethis closed 5 years ago

assemblethis commented 5 years ago

Part of the design of this Vue.js plugin is to have a default DB specified. Given this design priority I've modified all the functions of the api to be able to function without specifying the parameter db. This requires that the db parameter is the last parameter.

The only edge cases are with sync, push, and pull where the db parameter is the second to last parameter since it seemed strange to not have the remoteDB parameter follow the localDB parameter. So, you could leave out the remoteDB parameter and use the defaultdb but then you can't also specify options. So $pouch.push('todos') or $pouch.sync('todos') will work fine and use the default remoteDB, but you can't specify options, e.g $pouch.push('todos', options') or $pouch.sync('todos', options). If you wanted to specify options, then you need to specify the remoteDB parameter as well.

What's required now is that the plugin requires the defaultDB parameter to be set. If not, it gives a warning.