Skip to content

Commit

Permalink
0.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceK33z committed Jul 14, 2017
1 parent 3d0b76d commit cf651b9
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
40 changes: 40 additions & 0 deletions dist/mobx-spine.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ var createClass = (function() {
};
})();

var defineProperty = function(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}

return obj;
};

var _class$1;
var _descriptor$1;
var _descriptor2$1;
Expand Down Expand Up @@ -1616,6 +1631,24 @@ var Model = (
);
},
},
{
key: 'setInput',
value: function setInput(name, value) {
invariant(
this.__attributes.includes(name),
'Attribute `' +
name +
'` does not exist on the model.'
);
this[name] = value;
if (this.backendValidationErrors[name]) {
this.__backendValidationErrors = Object.assign(
this.backendValidationErrors,
defineProperty({}, name, undefined)
);
}
},
},
{
key: 'saveAll',
value: function saveAll() {
Expand Down Expand Up @@ -1925,6 +1958,13 @@ var Model = (
Object.getOwnPropertyDescriptor(_class.prototype, 'save'),
_class.prototype
),
_applyDecoratedDescriptor(
_class.prototype,
'setInput',
[action],
Object.getOwnPropertyDescriptor(_class.prototype, 'setInput'),
_class.prototype
),
_applyDecoratedDescriptor(
_class.prototype,
'saveAll',
Expand Down
40 changes: 40 additions & 0 deletions dist/mobx-spine.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@
};
})();

var defineProperty = function(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}

return obj;
};

var _class$1;
var _descriptor$1;
var _descriptor2$1;
Expand Down Expand Up @@ -1695,6 +1710,24 @@
);
},
},
{
key: 'setInput',
value: function setInput(name, value) {
invariant(
this.__attributes.includes(name),
'Attribute `' +
name +
'` does not exist on the model.'
);
this[name] = value;
if (this.backendValidationErrors[name]) {
this.__backendValidationErrors = Object.assign(
this.backendValidationErrors,
defineProperty({}, name, undefined)
);
}
},
},
{
key: 'saveAll',
value: function saveAll() {
Expand Down Expand Up @@ -2010,6 +2043,13 @@
Object.getOwnPropertyDescriptor(_class.prototype, 'save'),
_class.prototype
),
_applyDecoratedDescriptor(
_class.prototype,
'setInput',
[mobx.action],
Object.getOwnPropertyDescriptor(_class.prototype, 'setInput'),
_class.prototype
),
_applyDecoratedDescriptor(
_class.prototype,
'saveAll',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobx-spine",
"version": "0.15.3",
"version": "0.16.0",
"license": "ISC",
"author": "Kees Kluskens <[email protected]>",
"description": "MobX with support for models, relations and an API.",
Expand Down

0 comments on commit cf651b9

Please sign in to comment.