reactant-model 0.127.0 → 0.129.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -3
- package/dist/index.esm.js +4 -2
- package/dist/index.umd.js +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var mutative = require('mutative');
|
|
6
4
|
var reactantModule = require('reactant-module');
|
|
7
5
|
|
|
@@ -19,6 +17,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
19
17
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
20
18
|
PERFORMANCE OF THIS SOFTWARE.
|
|
21
19
|
***************************************************************************** */
|
|
20
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
21
|
+
|
|
22
22
|
|
|
23
23
|
var __assign = function() {
|
|
24
24
|
__assign = Object.assign || function __assign(t) {
|
|
@@ -58,7 +58,7 @@ function __spreadArray(to, from, pack) {
|
|
|
58
58
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
62
62
|
var e = new Error(message);
|
|
63
63
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
64
64
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { create } from 'mutative';
|
|
2
|
-
import { enablePatchesKey, stateKey,
|
|
2
|
+
import { enablePatchesKey, stateKey, enableAutoFreezeKey, strictKey, storeKey, identifierKey, nameKey, actionIdentifier } from 'reactant-module';
|
|
3
3
|
|
|
4
4
|
/******************************************************************************
|
|
5
5
|
Copyright (c) Microsoft Corporation.
|
|
@@ -15,6 +15,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
15
15
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
16
16
|
PERFORMANCE OF THIS SOFTWARE.
|
|
17
17
|
***************************************************************************** */
|
|
18
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
19
|
+
|
|
18
20
|
|
|
19
21
|
var __assign = function() {
|
|
20
22
|
__assign = Object.assign || function __assign(t) {
|
|
@@ -54,7 +56,7 @@ function __spreadArray(to, from, pack) {
|
|
|
54
56
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
58
60
|
var e = new Error(message);
|
|
59
61
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
60
62
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("mutative"),require("reactant-module")):"function"==typeof define&&define.amd?define(["exports","mutative","reactant-module"],t):t((e=e||self).reactantModel={},e.mutative,e.reactantModule)}(this,(function(e,t,r){"use strict";var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)};function a(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i}function o(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;e.model=function(e){var i,c;return Object.keys(e.actions).forEach((function(i){var l,s=e.actions[i];Object.assign(e.actions,((l={})[i]=function(){for(var e,l,u,f,y,p,d=[],
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("mutative"),require("reactant-module")):"function"==typeof define&&define.amd?define(["exports","mutative","reactant-module"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).reactantModel={},e.mutative,e.reactantModule)}(this,(function(e,t,r){"use strict";var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)};function a(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i}function o(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;e.model=function(e){var i,c;return Object.keys(e.actions).forEach((function(i){var l,s=e.actions[i];Object.assign(e.actions,((l={})[i]=function(){for(var e,l,u,f,y,p,d=[],h=0;h<arguments.length;h++)d[h]=arguments[h];c[r.enablePatchesKey]?(f=(e=a(t.create(c[r.stateKey],(function(e){s.apply(void 0,o([],a(d),!1))(e)}),{enablePatches:!0,strict:c[r.strictKey],enableAutoFreeze:c[r.enableAutoFreezeKey]}),3))[0],y=e[1],p=e[2]):f=t.create(c[r.stateKey],(function(e){s.apply(void 0,o([],a(d),!1))(e)}),{strict:c[r.strictKey],enableAutoFreeze:c[r.enableAutoFreezeKey]});var v=null===(u=c[r.storeKey])||void 0===u?void 0:u.getState();c[r.storeKey].dispatch(n({type:c[r.identifierKey],method:i,state:n(n({},v),(l={},l[c[r.identifierKey]]=f,l)),_reactant:r.actionIdentifier},c[r.enablePatchesKey]?{_patches:y,_inversePatches:p}:{}))},l))})),c=n(((i={})[r.nameKey]=e.name,i[r.stateKey]=n({},e.state),i),e.actions)}}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactant-model",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.129.0",
|
|
4
4
|
"description": "A model lib for Reactant",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"unpkg": "dist/index.umd.js",
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"mutative": "^1.1.0",
|
|
35
|
-
"reactant-module": "^0.
|
|
35
|
+
"reactant-module": "^0.129.0"
|
|
36
36
|
}
|
|
37
37
|
}
|