hoodiehq / hoodie-client

:dog: Client API for the Hoodie server
Apache License 2.0
34 stars 25 forks source link

pass options to plugins #148

Closed gr2m closed 7 years ago

gr2m commented 7 years ago

follow up for https://github.com/hoodiehq/hoodie/pull/711#issuecomment-306046905

Plugins have currently no way to access options passed to the Hoodie constructor. In order to make that possible, I’d suggest we allow to pass another argument to the hoodie.plugin(plugin), so that becomes possible:

hoodie.plugin(function (hoodie, options) {
  hoodie.myMethod = function () {
    // do something with options here
  }
})