| Total Complexity | 5 |
| Complexity/F | 1.67 |
| Lines of Code | 30 |
| Function Count | 3 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | import BaseVue from 'vue' |
||
| 2 | import VueSyncersFeathers from '../../../src' |
||
| 3 | |||
| 4 | export function addVueWithPlugin(t, options) { |
||
| 5 | const Vue = t.context.Vue = BaseVue.extend() |
||
| 6 | |||
| 7 | // Because we're installing onto extended vue instance copy global methods to new instance |
||
| 8 | Vue.version = BaseVue.version |
||
| 9 | Vue.util = BaseVue.util |
||
| 10 | Vue.set = BaseVue.set |
||
| 11 | Vue.delete = BaseVue.delete |
||
| 12 | Vue.nextTick = BaseVue.nextTick |
||
| 13 | Vue.config = BaseVue.config // Not cloned |
||
| 14 | // To reference the right Vue instance |
||
| 15 | Vue.mixin = function (mixin) { |
||
| 16 | Vue.options = Vue.util.mergeOptions(Vue.options, mixin) |
||
| 17 | } |
||
| 18 | |||
| 19 | BaseVue.use.call(Vue, {install: VueSyncersFeathers.install}, options) |
||
| 20 | } |
||
| 21 | |||
| 22 | export function vueCleanup(t) { |
||
| 23 | if (t.context.instance) { |
||
| 24 | t.context.instance.$destroy() |
||
| 25 | delete t.context.instance |
||
| 26 | } |
||
| 27 | if (t.context.Vue) { |
||
| 28 | delete t.context.Vue |
||
| 29 | } |
||
| 30 | } |
||
| 31 |