vuex-orm-decorators
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -16,3 +16,2 @@ import { Model } from '@vuex-orm/core'; | ||
return function (target, propertyName) { | ||
console.log(propertyName); | ||
target.constructor._fields = target.constructor._fields || {}; | ||
@@ -19,0 +18,0 @@ target.constructor._fields[propertyName] = fieldType; |
@@ -6,7 +6,6 @@ import VuexORM from '@vuex-orm/core'; | ||
ORMDatabase.install = function () { | ||
ORMDatabase._ormDatabase = new VuexORM.Database(); | ||
return VuexORM.install(ORMDatabase._ormDatabase); | ||
}; | ||
ORMDatabase.registerEntity = function (model) { | ||
if (ORMDatabase._ormDatabase && this._installed.indexOf(model) !== -1) { | ||
if (this._installed.indexOf(model) !== -1) { | ||
console.error("Unable to register entity " + model.name + ". Entity already registered."); | ||
@@ -17,2 +16,3 @@ return; | ||
}; | ||
ORMDatabase._ormDatabase = new VuexORM.Database(); | ||
ORMDatabase._installed = []; | ||
@@ -19,0 +19,0 @@ return ORMDatabase; |
{ | ||
"name": "vuex-orm-decorators", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Simple Typescript decorators to improve the vuex-orm experience in Typescript by introducing typed property access.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -21,3 +21,2 @@ import { Model, Attribute } from '@vuex-orm/core'; | ||
return (target: Object, propertyName: string | symbol): void => { | ||
console.log(propertyName); | ||
(target.constructor as any)._fields = (target.constructor as any)._fields || {}; | ||
@@ -24,0 +23,0 @@ (target.constructor as any)._fields[propertyName] = fieldType; |
@@ -7,7 +7,6 @@ import VuexORM, { Model, Database } from '@vuex-orm/core'; | ||
private static _ormDatabase: Database; | ||
private static _ormDatabase = new VuexORM.Database(); | ||
private static _installed = <typeof Model[]>[]; | ||
public static install(): Plugin<any> { | ||
ORMDatabase._ormDatabase = new VuexORM.Database(); | ||
return VuexORM.install(ORMDatabase._ormDatabase); | ||
@@ -17,3 +16,3 @@ } | ||
public static registerEntity(model: typeof Model) { | ||
if (ORMDatabase._ormDatabase && this._installed.indexOf(model) !== -1) { | ||
if (this._installed.indexOf(model) !== -1) { | ||
console.error(`Unable to register entity ${model.name}. Entity already registered.`) | ||
@@ -20,0 +19,0 @@ return; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
33391
407