overvue-rx
Version:
A library providing Vue applications with 'asynchronous-first' state management
22 lines (18 loc) • 590 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (Vue) {
var usesInit = Vue.config._lifecycleHooks.indexOf('init') > -1;
Vue.mixin(usesInit ? { init: overVueInit } : { beforeCreate: overVueInit });
// overVue init hook, injected into each instances' init hooks list.
function overVueInit() {
var options = this.$options;
// store injection
if (options.store) {
this.$store = options.store;
} else if (options.parent && options.parent.$store) {
this.$store = options.parent.$store;
}
}
};