Comparing version 1.0.3 to 2.0.0
@@ -10,3 +10,3 @@ 'use strict'; | ||
var _desc, _value, _class, _descriptor, _descriptor2, _descriptor3; | ||
var _desc, _value, _class; | ||
@@ -29,12 +29,2 @@ var _mobx = require('mobx'); | ||
function _initDefineProp(target, property, descriptor, context) { | ||
if (!descriptor) return; | ||
Object.defineProperty(target, property, { | ||
enumerable: descriptor.enumerable, | ||
configurable: descriptor.configurable, | ||
writable: descriptor.writable, | ||
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 | ||
}); | ||
} | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -71,6 +61,2 @@ | ||
function _initializerWarningHelper(descriptor, context) { | ||
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); | ||
} | ||
var Collection = (_class = function () { | ||
@@ -82,8 +68,6 @@ function Collection() { | ||
_initDefineProp(this, 'request', _descriptor, this); | ||
this.request = _mobx.observable.shallowObject(null); | ||
this.error = _mobx.observable.shallowObject(null); | ||
this.models = _mobx.observable.shallowArray([]); | ||
_initDefineProp(this, 'error', _descriptor2, this); | ||
_initDefineProp(this, 'models', _descriptor3, this); | ||
this.set(data); | ||
@@ -329,3 +313,3 @@ } | ||
label: label, | ||
abort: (0, _mobx.asReference)(abort), | ||
abort: abort, | ||
progress: 0 | ||
@@ -337,3 +321,3 @@ }; | ||
label: label, | ||
abort: (0, _mobx.asReference)(abort), | ||
abort: abort, | ||
progress: 0 | ||
@@ -423,3 +407,3 @@ }; | ||
label: label, | ||
abort: (0, _mobx.asReference)(abort), | ||
abort: abort, | ||
progress: 0 | ||
@@ -498,3 +482,3 @@ }; | ||
label: label, | ||
abort: (0, _mobx.asReference)(abort), | ||
abort: abort, | ||
progress: 0 | ||
@@ -547,18 +531,3 @@ }; | ||
return Collection; | ||
}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'request', [_mobx.observable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return null; | ||
} | ||
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'error', [_mobx.observable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return null; | ||
} | ||
}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, 'models', [_mobx.observable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return []; | ||
} | ||
}), _applyDecoratedDescriptor(_class.prototype, 'add', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'add'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'remove', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'remove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'set', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'set'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'create', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'create'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'fetch', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'fetch'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'rpc', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'rpc'), _class.prototype)), _class); | ||
}(), (_applyDecoratedDescriptor(_class.prototype, 'add', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'add'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'remove', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'remove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'set', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'set'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'create', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'create'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'fetch', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'fetch'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'rpc', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'rpc'), _class.prototype)), _class); | ||
exports.default = Collection; |
@@ -10,3 +10,3 @@ 'use strict'; | ||
var _desc, _value, _class, _descriptor, _descriptor2; | ||
var _desc, _value, _class; | ||
@@ -29,12 +29,2 @@ var _mobx = require('mobx'); | ||
function _initDefineProp(target, property, descriptor, context) { | ||
if (!descriptor) return; | ||
Object.defineProperty(target, property, { | ||
enumerable: descriptor.enumerable, | ||
configurable: descriptor.configurable, | ||
writable: descriptor.writable, | ||
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 | ||
}); | ||
} | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -71,6 +61,2 @@ | ||
function _initializerWarningHelper(descriptor, context) { | ||
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); | ||
} | ||
var Model = (_class = function () { | ||
@@ -82,10 +68,8 @@ function Model() { | ||
_initDefineProp(this, 'request', _descriptor, this); | ||
_initDefineProp(this, 'error', _descriptor2, this); | ||
this.request = _mobx.observable.shallowObject(null); | ||
this.error = _mobx.observable.shallowObject(null); | ||
this.optimisticId = (0, _lodash.uniqueId)('i_'); | ||
this.collection = null; | ||
this.attributes = (0, _mobx.asMap)(attributes); | ||
this.attributes = _mobx.observable.map(attributes); | ||
} | ||
@@ -209,3 +193,3 @@ | ||
label: label, | ||
abort: (0, _mobx.asReference)(abort), | ||
abort: abort, | ||
progress: 0 | ||
@@ -327,3 +311,3 @@ }; | ||
label: label, | ||
abort: (0, _mobx.asReference)(abort), | ||
abort: abort, | ||
progress: 0 | ||
@@ -411,3 +395,3 @@ }; | ||
label: label, | ||
abort: (0, _mobx.asReference)(abort), | ||
abort: abort, | ||
progress: 0 | ||
@@ -503,3 +487,3 @@ }; | ||
label: label, | ||
abort: (0, _mobx.asReference)(abort), | ||
abort: abort, | ||
progress: 0 | ||
@@ -581,3 +565,3 @@ }; | ||
label: label, | ||
abort: (0, _mobx.asReference)(abort), | ||
abort: abort, | ||
progress: 0 | ||
@@ -646,13 +630,3 @@ }; | ||
return Model; | ||
}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'request', [_mobx.observable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return null; | ||
} | ||
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'error', [_mobx.observable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return (0, _mobx.asFlat)(null); | ||
} | ||
}), _applyDecoratedDescriptor(_class.prototype, 'isNew', [_mobx.computed], Object.getOwnPropertyDescriptor(_class.prototype, 'isNew'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'set', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'set'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'fetch', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'fetch'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'save', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'save'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'destroy', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'destroy'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'rpc', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'rpc'), _class.prototype)), _class); | ||
}(), (_applyDecoratedDescriptor(_class.prototype, 'isNew', [_mobx.computed], Object.getOwnPropertyDescriptor(_class.prototype, 'isNew'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'set', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'set'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'fetch', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'fetch'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'save', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'save'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'destroy', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'destroy'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'rpc', [_mobx.action], Object.getOwnPropertyDescriptor(_class.prototype, 'rpc'), _class.prototype)), _class); | ||
exports.default = Model; |
{ | ||
"name": "mobx-rest", | ||
"version": "1.0.3", | ||
"version": "2.0.0", | ||
"description": "REST conventions for mobx.", | ||
@@ -19,19 +19,19 @@ "repository": { | ||
"lodash": "^4.17.4", | ||
"mobx": "^2.7.0" | ||
"mobx": "^3.1.5" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.10.1", | ||
"babel-core": "^6.10.4", | ||
"babel-cli": "^6.23.0", | ||
"babel-core": "^6.23.1", | ||
"babel-eslint": "^7.1.1", | ||
"babel-jest": "^18.0.0", | ||
"babel-jest": "^19.0.0", | ||
"babel-plugin-transform-decorators-legacy": "^1.3.4", | ||
"babel-plugin-transform-flow-strip-types": "^6.8.0", | ||
"babel-polyfill": "^6.9.1", | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-preset-stage-1": "^6.5.0", | ||
"babel-register": "^6.9.0", | ||
"flow-bin": "^0.38.0", | ||
"jest": "^18.1.0", | ||
"babel-plugin-transform-flow-strip-types": "^6.22.0", | ||
"babel-polyfill": "^6.23.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
"babel-preset-stage-1": "^6.22.0", | ||
"babel-register": "^6.23.0", | ||
"flow-bin": "^0.41.0", | ||
"jest": "^19.0.2", | ||
"snazzy": "^6.0.0", | ||
"standard": "^8.6.0" | ||
"standard": "^9.0.1" | ||
}, | ||
@@ -38,0 +38,0 @@ "main": "lib", |
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
64481
1611
+ Addedmobx@3.6.2(transitive)
- Removedmobx@2.7.0(transitive)
Updatedmobx@^3.1.5