modeled-mobx
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -210,9 +210,4 @@ var mobx = require('mobx'); | ||
if (!properties) { | ||
if (!properties && !decoratedSchema || properties && properties.decorateOnly) { | ||
mobx.makeObservable(model); | ||
if (!decoratedSchema) { | ||
return; // no decorators have created schema | ||
} | ||
return; | ||
@@ -223,7 +218,11 @@ } | ||
const mobxAnnotations = {}; | ||
Object.keys(properties).forEach(property => { | ||
if (!schema.recordProperty(property, properties[property])) { | ||
mobxAnnotations[property] = properties[property]; | ||
} | ||
}); | ||
if (properties) { | ||
Object.keys(properties).forEach(property => { | ||
if (!schema.recordProperty(property, properties[property])) { | ||
mobxAnnotations[property] = properties[property]; | ||
} | ||
}); | ||
} | ||
schema.properties.forEach((options, key) => { | ||
@@ -230,0 +229,0 @@ if (!options.annotated) { |
@@ -210,9 +210,4 @@ import { observable, intercept, isObservableArray, makeObservable } from 'mobx'; | ||
if (!properties) { | ||
if (!properties && !decoratedSchema || properties && properties.decorateOnly) { | ||
makeObservable(model); | ||
if (!decoratedSchema) { | ||
return; // no decorators have created schema | ||
} | ||
return; | ||
@@ -223,7 +218,11 @@ } | ||
const mobxAnnotations = {}; | ||
Object.keys(properties).forEach(property => { | ||
if (!schema.recordProperty(property, properties[property])) { | ||
mobxAnnotations[property] = properties[property]; | ||
} | ||
}); | ||
if (properties) { | ||
Object.keys(properties).forEach(property => { | ||
if (!schema.recordProperty(property, properties[property])) { | ||
mobxAnnotations[property] = properties[property]; | ||
} | ||
}); | ||
} | ||
schema.properties.forEach((options, key) => { | ||
@@ -230,0 +229,0 @@ if (!options.annotated) { |
@@ -210,9 +210,4 @@ import { observable, intercept, isObservableArray, makeObservable } from 'mobx'; | ||
if (!properties) { | ||
if (!properties && !decoratedSchema || properties && properties.decorateOnly) { | ||
makeObservable(model); | ||
if (!decoratedSchema) { | ||
return; // no decorators have created schema | ||
} | ||
return; | ||
@@ -223,7 +218,11 @@ } | ||
const mobxAnnotations = {}; | ||
Object.keys(properties).forEach(property => { | ||
if (!schema.recordProperty(property, properties[property])) { | ||
mobxAnnotations[property] = properties[property]; | ||
} | ||
}); | ||
if (properties) { | ||
Object.keys(properties).forEach(property => { | ||
if (!schema.recordProperty(property, properties[property])) { | ||
mobxAnnotations[property] = properties[property]; | ||
} | ||
}); | ||
} | ||
schema.properties.forEach((options, key) => { | ||
@@ -230,0 +229,0 @@ if (!options.annotated) { |
@@ -213,9 +213,4 @@ (function (global, factory) { | ||
if (!properties) { | ||
if (!properties && !decoratedSchema || properties && properties.decorateOnly) { | ||
mobx.makeObservable(model); | ||
if (!decoratedSchema) { | ||
return; // no decorators have created schema | ||
} | ||
return; | ||
@@ -226,7 +221,11 @@ } | ||
const mobxAnnotations = {}; | ||
Object.keys(properties).forEach(property => { | ||
if (!schema.recordProperty(property, properties[property])) { | ||
mobxAnnotations[property] = properties[property]; | ||
} | ||
}); | ||
if (properties) { | ||
Object.keys(properties).forEach(property => { | ||
if (!schema.recordProperty(property, properties[property])) { | ||
mobxAnnotations[property] = properties[property]; | ||
} | ||
}); | ||
} | ||
schema.properties.forEach((options, key) => { | ||
@@ -233,0 +232,0 @@ if (!options.annotated) { |
@@ -6,3 +6,7 @@ import { CreateObservableOptions } from "mobx"; | ||
}; | ||
declare type DecorateOnly = { | ||
decorateOnly: true; | ||
}; | ||
export declare function modelize(model: ModelInstance, properties: DecorateOnly): void; | ||
export declare function modelize(model: ModelInstance, properties?: ModelizeProperties<ModelInstance>, options?: CreateObservableOptions): void; | ||
export {}; |
{ | ||
"name": "modeled-mobx", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "MobX powered classes with type-coercion and serialization/hydration", | ||
@@ -5,0 +5,0 @@ "author": "nathanstitt", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
99569
24
927