state-decorator 7.0.0-rc4 → 7.0.0-rc5
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/es/helpers.d.ts +10 -9
- package/es/helpers.js +1 -1
- package/helpers.d.ts +10 -9
- package/helpers.js +1 -1
- package/package.json +1 -1
package/es/helpers.d.ts
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Effect function that sets the first action argument to the specified prop.
|
|
3
|
+
* if dirtyProp is set
|
|
3
4
|
*/
|
|
4
|
-
export declare function setArgIn<S, K extends keyof S>(propName: K): (ctx: {
|
|
5
|
+
export declare function setArgIn<S, K extends keyof S, K2 extends keyof S>(propName: K, dirtyProp?: K2): (ctx: {
|
|
5
6
|
s: S;
|
|
6
7
|
args: [S[K]];
|
|
7
8
|
}) => Partial<S>;
|
|
8
9
|
/**
|
|
9
10
|
* Effect function that sets <code>true</code> in the specified prop.
|
|
10
11
|
*/
|
|
11
|
-
export declare function setTrueIn<S, K extends keyof S>(propName: K): (ctx: {
|
|
12
|
+
export declare function setTrueIn<S, K extends keyof S, K2 extends keyof S>(propName: K, dirtyProp?: K2): (ctx: {
|
|
12
13
|
s: S;
|
|
13
14
|
}) => Partial<S>;
|
|
14
15
|
/**
|
|
15
16
|
* Effect function that sets <code>false</code> in the specified prop.
|
|
16
17
|
*/
|
|
17
|
-
export declare function setFalseIn<S, K extends keyof S>(propName: K): (ctx: {
|
|
18
|
+
export declare function setFalseIn<S, K extends keyof S, K2 extends keyof S>(propName: K, dirtyProp?: K2): (ctx: {
|
|
18
19
|
s: S;
|
|
19
20
|
}) => Partial<S>;
|
|
20
21
|
/**
|
|
21
22
|
* Effect function that sets toggles the boolean value of the specified prop.
|
|
22
23
|
*/
|
|
23
|
-
export declare function toggleProp<S, K extends keyof S>(propName: K): (ctx: {
|
|
24
|
+
export declare function toggleProp<S, K extends keyof S, K2 extends keyof S>(propName: K, dirtyProp?: K2): (ctx: {
|
|
24
25
|
s: S;
|
|
25
26
|
}) => Partial<S>;
|
|
26
27
|
/**
|
|
27
28
|
* Effect function that sets the update the specifed prop as an array using first action argument as index
|
|
28
29
|
* and second as value to set.
|
|
29
30
|
*/
|
|
30
|
-
export declare function setArgsInMap<S, K extends keyof S, T>(propName: K): (ctx: {
|
|
31
|
+
export declare function setArgsInMap<S, K extends keyof S, K2 extends keyof S, T>(propName: K, dirtyProp?: K2): (ctx: {
|
|
31
32
|
s: S;
|
|
32
33
|
args: [string, T];
|
|
33
34
|
}) => Partial<S>;
|
|
@@ -35,14 +36,14 @@ export declare function setArgsInMap<S, K extends keyof S, T>(propName: K): (ctx
|
|
|
35
36
|
* Effect function that sets the update the specifed prop as an array using first action argument as index
|
|
36
37
|
* and second as value to set.
|
|
37
38
|
*/
|
|
38
|
-
export declare function setArgsInArray<S, K extends keyof S, T>(propName: K): (ctx: {
|
|
39
|
+
export declare function setArgsInArray<S, K extends keyof S, K2 extends keyof S, T>(propName: K, dirtyProp?: K2): (ctx: {
|
|
39
40
|
s: S;
|
|
40
41
|
args: [number, T];
|
|
41
42
|
}) => Partial<S>;
|
|
42
43
|
/**
|
|
43
44
|
* Effect function that sets the asynchronous action result to the specified prop.
|
|
44
45
|
*/
|
|
45
|
-
export declare function setResIn<S, K extends keyof S>(propName: K): (ctx: {
|
|
46
|
+
export declare function setResIn<S, K extends keyof S, K2 extends keyof S>(propName: K, dirtyProp?: K2): (ctx: {
|
|
46
47
|
s: S;
|
|
47
48
|
res: S[K];
|
|
48
49
|
}) => Partial<S>;
|
|
@@ -50,7 +51,7 @@ export declare function setResIn<S, K extends keyof S>(propName: K): (ctx: {
|
|
|
50
51
|
* Effect function that sets the update the specifed prop as an array using first action argument as index
|
|
51
52
|
* and second as value to set.
|
|
52
53
|
*/
|
|
53
|
-
export declare function setResInArray<S, K extends keyof S, T>(propName: K): (ctx: {
|
|
54
|
+
export declare function setResInArray<S, K extends keyof S, K2 extends keyof S, T>(propName: K, dirtyProp?: K2): (ctx: {
|
|
54
55
|
s: S;
|
|
55
56
|
args: [number];
|
|
56
57
|
res: T;
|
|
@@ -59,7 +60,7 @@ export declare function setResInArray<S, K extends keyof S, T>(propName: K): (ct
|
|
|
59
60
|
* Effect function that sets the update the specifed prop as an array using first action argument as index
|
|
60
61
|
* and second as value to set.
|
|
61
62
|
*/
|
|
62
|
-
export declare function setResInMap<S, K extends keyof S, T>(propName: K): (ctx: {
|
|
63
|
+
export declare function setResInMap<S, K extends keyof S, K2 extends keyof S, T>(propName: K, dirtyProp?: K2): (ctx: {
|
|
63
64
|
s: S;
|
|
64
65
|
args: [string];
|
|
65
66
|
res: T;
|
package/es/helpers.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var r=function(){return r=Object.assign||function(r){for(var n,t=1,u=arguments.length;t<u;t++)for(var e in n=arguments[t])Object.prototype.hasOwnProperty.call(n,e)&&(r[e]=n[e]);return r},r.apply(this,arguments)};function n(r,n,t){if(t||2===arguments.length)for(var u,e=0,o=n.length;e<o;e++)!u&&e in n||(u||(u=Array.prototype.slice.call(n,0,e)),u[e]=n[e]);return r.concat(u||Array.prototype.slice.call(n))}function t(r){return function(n){var
|
|
1
|
+
var r=function(){return r=Object.assign||function(r){for(var n,t=1,u=arguments.length;t<u;t++)for(var e in n=arguments[t])Object.prototype.hasOwnProperty.call(n,e)&&(r[e]=n[e]);return r},r.apply(this,arguments)};function n(r,n,t){if(t||2===arguments.length)for(var u,e=0,o=n.length;e<o;e++)!u&&e in n||(u||(u=Array.prototype.slice.call(n,0,e)),u[e]=n[e]);return r.concat(u||Array.prototype.slice.call(n))}function t(r,n){return n&&(r[n]=!0),r}function u(r,n){return function(u){var e,o=u.s,c=u.args[0];return o[r]===c?null:t(((e={})[r]=c,e),n)}}function e(r,n){return function(u){var e;return u.s[r]?null:t(((e={})[r]=!0,e),n)}}function o(r,n){return function(u){var e;return u.s[r]?t(((e={})[r]=!1,e),n):null}}function c(r,n){return function(u){var e,o=u.s;return t(((e={})[r]=!o[r],e),n)}}function i(n,u){return function(e){var o,c,i=e.s,a=e.args,f=a[0],s=a[1];return t(((o={})[n]=r(r({},i[n]),((c={})[f]=s,c)),o),u)}}function a(r,u){return function(e){var o,c=e.s,i=e.args,a=i[0],f=i[1],s=n([],c[r],!0);return s[a]=f,t(((o={})[r]=s,o),u)}}function f(r,n){return function(u){var e,o=u.res;return t(((e={})[r]=o,e),n)}}function s(r,u){return function(e){var o,c=e.s,i=e.args[0],a=e.res,f=n([],c[r],!0);return f[i]=a,t(((o={})[r]=f,o),u)}}function l(n,u){return function(e){var o,c,i=e.s,a=e.args[0],f=e.res;return t(((o={})[n]=r(r({},i[n]),((c={})[a]=f,c)),o),u)}}export{u as setArgIn,a as setArgsInArray,i as setArgsInMap,o as setFalseIn,f as setResIn,s as setResInArray,l as setResInMap,e as setTrueIn,c as toggleProp};
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
package/helpers.d.ts
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Effect function that sets the first action argument to the specified prop.
|
|
3
|
+
* if dirtyProp is set
|
|
3
4
|
*/
|
|
4
|
-
export declare function setArgIn<S, K extends keyof S>(propName: K): (ctx: {
|
|
5
|
+
export declare function setArgIn<S, K extends keyof S, K2 extends keyof S>(propName: K, dirtyProp?: K2): (ctx: {
|
|
5
6
|
s: S;
|
|
6
7
|
args: [S[K]];
|
|
7
8
|
}) => Partial<S>;
|
|
8
9
|
/**
|
|
9
10
|
* Effect function that sets <code>true</code> in the specified prop.
|
|
10
11
|
*/
|
|
11
|
-
export declare function setTrueIn<S, K extends keyof S>(propName: K): (ctx: {
|
|
12
|
+
export declare function setTrueIn<S, K extends keyof S, K2 extends keyof S>(propName: K, dirtyProp?: K2): (ctx: {
|
|
12
13
|
s: S;
|
|
13
14
|
}) => Partial<S>;
|
|
14
15
|
/**
|
|
15
16
|
* Effect function that sets <code>false</code> in the specified prop.
|
|
16
17
|
*/
|
|
17
|
-
export declare function setFalseIn<S, K extends keyof S>(propName: K): (ctx: {
|
|
18
|
+
export declare function setFalseIn<S, K extends keyof S, K2 extends keyof S>(propName: K, dirtyProp?: K2): (ctx: {
|
|
18
19
|
s: S;
|
|
19
20
|
}) => Partial<S>;
|
|
20
21
|
/**
|
|
21
22
|
* Effect function that sets toggles the boolean value of the specified prop.
|
|
22
23
|
*/
|
|
23
|
-
export declare function toggleProp<S, K extends keyof S>(propName: K): (ctx: {
|
|
24
|
+
export declare function toggleProp<S, K extends keyof S, K2 extends keyof S>(propName: K, dirtyProp?: K2): (ctx: {
|
|
24
25
|
s: S;
|
|
25
26
|
}) => Partial<S>;
|
|
26
27
|
/**
|
|
27
28
|
* Effect function that sets the update the specifed prop as an array using first action argument as index
|
|
28
29
|
* and second as value to set.
|
|
29
30
|
*/
|
|
30
|
-
export declare function setArgsInMap<S, K extends keyof S, T>(propName: K): (ctx: {
|
|
31
|
+
export declare function setArgsInMap<S, K extends keyof S, K2 extends keyof S, T>(propName: K, dirtyProp?: K2): (ctx: {
|
|
31
32
|
s: S;
|
|
32
33
|
args: [string, T];
|
|
33
34
|
}) => Partial<S>;
|
|
@@ -35,14 +36,14 @@ export declare function setArgsInMap<S, K extends keyof S, T>(propName: K): (ctx
|
|
|
35
36
|
* Effect function that sets the update the specifed prop as an array using first action argument as index
|
|
36
37
|
* and second as value to set.
|
|
37
38
|
*/
|
|
38
|
-
export declare function setArgsInArray<S, K extends keyof S, T>(propName: K): (ctx: {
|
|
39
|
+
export declare function setArgsInArray<S, K extends keyof S, K2 extends keyof S, T>(propName: K, dirtyProp?: K2): (ctx: {
|
|
39
40
|
s: S;
|
|
40
41
|
args: [number, T];
|
|
41
42
|
}) => Partial<S>;
|
|
42
43
|
/**
|
|
43
44
|
* Effect function that sets the asynchronous action result to the specified prop.
|
|
44
45
|
*/
|
|
45
|
-
export declare function setResIn<S, K extends keyof S>(propName: K): (ctx: {
|
|
46
|
+
export declare function setResIn<S, K extends keyof S, K2 extends keyof S>(propName: K, dirtyProp?: K2): (ctx: {
|
|
46
47
|
s: S;
|
|
47
48
|
res: S[K];
|
|
48
49
|
}) => Partial<S>;
|
|
@@ -50,7 +51,7 @@ export declare function setResIn<S, K extends keyof S>(propName: K): (ctx: {
|
|
|
50
51
|
* Effect function that sets the update the specifed prop as an array using first action argument as index
|
|
51
52
|
* and second as value to set.
|
|
52
53
|
*/
|
|
53
|
-
export declare function setResInArray<S, K extends keyof S, T>(propName: K): (ctx: {
|
|
54
|
+
export declare function setResInArray<S, K extends keyof S, K2 extends keyof S, T>(propName: K, dirtyProp?: K2): (ctx: {
|
|
54
55
|
s: S;
|
|
55
56
|
args: [number];
|
|
56
57
|
res: T;
|
|
@@ -59,7 +60,7 @@ export declare function setResInArray<S, K extends keyof S, T>(propName: K): (ct
|
|
|
59
60
|
* Effect function that sets the update the specifed prop as an array using first action argument as index
|
|
60
61
|
* and second as value to set.
|
|
61
62
|
*/
|
|
62
|
-
export declare function setResInMap<S, K extends keyof S, T>(propName: K): (ctx: {
|
|
63
|
+
export declare function setResInMap<S, K extends keyof S, K2 extends keyof S, T>(propName: K, dirtyProp?: K2): (ctx: {
|
|
63
64
|
s: S;
|
|
64
65
|
args: [string];
|
|
65
66
|
res: T;
|
package/helpers.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=function(){return r=Object.assign||function(r){for(var n,t=1,e=arguments.length;t<e;t++)for(var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=function(){return r=Object.assign||function(r){for(var n,t=1,e=arguments.length;t<e;t++)for(var u in n=arguments[t])Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u]);return r},r.apply(this,arguments)};function n(r,n,t){if(t||2===arguments.length)for(var e,u=0,s=n.length;u<s;u++)!e&&u in n||(e||(e=Array.prototype.slice.call(n,0,u)),e[u]=n[u]);return r.concat(e||Array.prototype.slice.call(n))}function t(r,n){return n&&(r[n]=!0),r}exports.setArgIn=function(r,n){return function(e){var u,s=e.s,o=e.args[0];return s[r]===o?null:t(((u={})[r]=o,u),n)}},exports.setArgsInArray=function(r,e){return function(u){var s,o=u.s,a=u.args,c=a[0],i=a[1],f=n([],o[r],!0);return f[c]=i,t(((s={})[r]=f,s),e)}},exports.setArgsInMap=function(n,e){return function(u){var s,o,a=u.s,c=u.args,i=c[0],f=c[1];return t(((s={})[n]=r(r({},a[n]),((o={})[i]=f,o)),s),e)}},exports.setFalseIn=function(r,n){return function(e){var u;return e.s[r]?t(((u={})[r]=!1,u),n):null}},exports.setResIn=function(r,n){return function(e){var u,s=e.res;return t(((u={})[r]=s,u),n)}},exports.setResInArray=function(r,e){return function(u){var s,o=u.s,a=u.args[0],c=u.res,i=n([],o[r],!0);return i[a]=c,t(((s={})[r]=i,s),e)}},exports.setResInMap=function(n,e){return function(u){var s,o,a=u.s,c=u.args[0],i=u.res;return t(((s={})[n]=r(r({},a[n]),((o={})[c]=i,o)),s),e)}},exports.setTrueIn=function(r,n){return function(e){var u;return e.s[r]?null:t(((u={})[r]=!0,u),n)}},exports.toggleProp=function(r,n){return function(e){var u,s=e.s;return t(((u={})[r]=!s[r],u),n)}};
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|