vue-model-x
Advanced tools
Comparing version 0.5.2 to 0.5.3
import { AppContainer } from './AppContainer'; | ||
export function vueModelXPlugin(Vue, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
export function vueModelXPlugin(Vue, _temp) { | ||
var _ref = _temp === void 0 ? {} : _temp, | ||
appContainer = _ref.appContainer, | ||
state = _ref.state, | ||
_ref$injectProperty = _ref.injectProperty, | ||
injectProperty = _ref$injectProperty === void 0 ? '$app' : _ref$injectProperty; | ||
var _opts = opts, | ||
appContainer = _opts.appContainer; | ||
var appContainerProp = opts.injectProperty || '$app'; | ||
if (!appContainer) { | ||
appContainer = new AppContainer(opts.state); | ||
appContainer = new AppContainer(state); | ||
} | ||
@@ -18,5 +16,6 @@ | ||
var stores = this.$options.stores; | ||
this[appContainerProp] = appContainer; | ||
if (stores) { | ||
this[injectProperty] = appContainer; | ||
var _arr = Object.keys(stores); | ||
@@ -23,0 +22,0 @@ |
@@ -8,13 +8,11 @@ "use strict"; | ||
function vueModelXPlugin(Vue, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function vueModelXPlugin(Vue, _temp) { | ||
var _ref = _temp === void 0 ? {} : _temp, | ||
appContainer = _ref.appContainer, | ||
state = _ref.state, | ||
_ref$injectProperty = _ref.injectProperty, | ||
injectProperty = _ref$injectProperty === void 0 ? '$app' : _ref$injectProperty; | ||
var _opts = opts, | ||
appContainer = _opts.appContainer; | ||
var appContainerProp = opts.injectProperty || '$app'; | ||
if (!appContainer) { | ||
appContainer = new _AppContainer.AppContainer(opts.state); | ||
appContainer = new _AppContainer.AppContainer(state); | ||
} | ||
@@ -25,5 +23,6 @@ | ||
var stores = this.$options.stores; | ||
this[appContainerProp] = appContainer; | ||
if (stores) { | ||
this[injectProperty] = appContainer; | ||
var _arr = Object.keys(stores); | ||
@@ -30,0 +29,0 @@ |
{ | ||
"name": "vue-model-x", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "MobX-like state management library for Vue.js", | ||
@@ -34,5 +34,5 @@ "main": "./lib/index.js", | ||
"@babel/preset-env": "7.0.0-beta.44", | ||
"@vue/test-utils": "1.0.0-beta.13", | ||
"@vue/test-utils": "1.0.0-beta.15", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-eslint": "8.2.2", | ||
"babel-eslint": "8.2.3", | ||
"babel-jest": "22.4.3", | ||
@@ -39,0 +39,0 @@ "eslint": "4.19.1", |
import {AppContainer} from './AppContainer'; | ||
export function vueModelXPlugin(Vue, opts = {}) { | ||
let {appContainer} = opts; | ||
const appContainerProp = opts.injectProperty || '$app'; | ||
export function vueModelXPlugin(Vue, | ||
{ | ||
appContainer, | ||
state, | ||
injectProperty = '$app' | ||
} = {} | ||
) { | ||
if (!appContainer) { | ||
appContainer = new AppContainer(opts.state); | ||
appContainer = new AppContainer(state); | ||
} | ||
@@ -16,5 +19,5 @@ | ||
this[appContainerProp] = appContainer; | ||
if (stores) { | ||
this[injectProperty] = appContainer; | ||
if (stores) { | ||
for (const propName of Object.keys(stores)) { | ||
@@ -21,0 +24,0 @@ this[propName] = appContainer.getStore(stores[propName]); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27710
788