Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Default values in additional configuration #26

Open
alexdeia opened this issue Oct 4, 2021 · 0 comments
Open

Default values in additional configuration #26

alexdeia opened this issue Oct 4, 2021 · 0 comments

Comments

@alexdeia
Copy link

alexdeia commented Oct 4, 2021

Hi. Are you sure that option object works properly? Because when I tried to reproduce disabling of one any features

Vue.use(VueOffline, {
    mixin: false
})

or

Vue.use(VueOffline, {
    storage: false
})

I got completely disabling them.

Look into options and default values.

export const VueOfflinePlugin = {
  install (Vue, options = { mixin: true, storage: true }) {
    const pluginOptions = {
      mixin: options.mixin,
      storage: options.storage
    }
    if (pluginOptions.storage) Vue.prototype.$offlineStorage = VueOfflineStorage
    if (pluginOptions.mixin) Vue.mixin(VueOfflineMixin)
  }
}

One of the params overwrites the other to undefined.
I prepared the PR this -> #25

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant