@coaction/xstate 3.2.0 → 4.0.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.js +0 -11
- package/dist/index.mjs +0 -11
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -12,9 +12,6 @@ const assignContext = (target, source) => {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
const unsupportedMutationMessage = "XState binding state cannot be mutated directly. Please use actor events.";
|
|
15
|
-
/**
|
|
16
|
-
* Bind an XState actor to Coaction.
|
|
17
|
-
*/
|
|
18
15
|
const bindXState = (0, coaction_adapter.createBinder)({
|
|
19
16
|
handleStore: (store, rawState, _state, internal) => {
|
|
20
17
|
const actor = actorMap.get(rawState);
|
|
@@ -28,11 +25,6 @@ const bindXState = (0, coaction_adapter.createBinder)({
|
|
|
28
25
|
if (operation === "apply" && isApplyingActorSnapshot) return;
|
|
29
26
|
throw new Error(unsupportedMutationMessage);
|
|
30
27
|
};
|
|
31
|
-
const baseApply = store.apply.bind(store);
|
|
32
|
-
store.apply = (state, patches) => {
|
|
33
|
-
if (!isApplyingActorSnapshot) throw new Error(unsupportedMutationMessage);
|
|
34
|
-
return baseApply(state, patches);
|
|
35
|
-
};
|
|
36
28
|
const applyActorSnapshot = (context) => {
|
|
37
29
|
isApplyingActorSnapshot = true;
|
|
38
30
|
try {
|
|
@@ -73,9 +65,6 @@ const bindXState = (0, coaction_adapter.createBinder)({
|
|
|
73
65
|
};
|
|
74
66
|
})
|
|
75
67
|
});
|
|
76
|
-
/**
|
|
77
|
-
* Adapt a state type for Coaction create function.
|
|
78
|
-
*/
|
|
79
68
|
const adapt = (store) => store;
|
|
80
69
|
//#endregion
|
|
81
70
|
exports.adapt = adapt;
|
package/dist/index.mjs
CHANGED
|
@@ -12,9 +12,6 @@ const assignContext = (target, source) => {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
const unsupportedMutationMessage = "XState binding state cannot be mutated directly. Please use actor events.";
|
|
15
|
-
/**
|
|
16
|
-
* Bind an XState actor to Coaction.
|
|
17
|
-
*/
|
|
18
15
|
const bindXState = createBinder({
|
|
19
16
|
handleStore: (store, rawState, _state, internal) => {
|
|
20
17
|
const actor = actorMap.get(rawState);
|
|
@@ -28,11 +25,6 @@ const bindXState = createBinder({
|
|
|
28
25
|
if (operation === "apply" && isApplyingActorSnapshot) return;
|
|
29
26
|
throw new Error(unsupportedMutationMessage);
|
|
30
27
|
};
|
|
31
|
-
const baseApply = store.apply.bind(store);
|
|
32
|
-
store.apply = (state, patches) => {
|
|
33
|
-
if (!isApplyingActorSnapshot) throw new Error(unsupportedMutationMessage);
|
|
34
|
-
return baseApply(state, patches);
|
|
35
|
-
};
|
|
36
28
|
const applyActorSnapshot = (context) => {
|
|
37
29
|
isApplyingActorSnapshot = true;
|
|
38
30
|
try {
|
|
@@ -73,9 +65,6 @@ const bindXState = createBinder({
|
|
|
73
65
|
};
|
|
74
66
|
})
|
|
75
67
|
});
|
|
76
|
-
/**
|
|
77
|
-
* Adapt a state type for Coaction create function.
|
|
78
|
-
*/
|
|
79
68
|
const adapt = (store) => store;
|
|
80
69
|
//#endregion
|
|
81
70
|
export { adapt, bindXState };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coaction/xstate",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "A Coaction integration tool for XState",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"actor",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"xstate": "^5.23.0",
|
|
49
|
-
"coaction": "
|
|
49
|
+
"coaction": "4.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"coaction": "^
|
|
52
|
+
"coaction": "^4.0.0",
|
|
53
53
|
"xstate": "^5.0.0"
|
|
54
54
|
},
|
|
55
55
|
"authors": [
|