@xstate/effect 0.1.0-alpha.5 → 0.1.0-alpha.6
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/README.md
CHANGED
|
@@ -7,14 +7,14 @@ Combine XState's event-driven workflows with Effect services, scopes, clocks and
|
|
|
7
7
|
- Provide services once for the actor and its child logic.
|
|
8
8
|
- Keep actor lifetime inside your Effect application.
|
|
9
9
|
|
|
10
|
-
This package is experimental. It targets XState v6 alpha and Effect 4
|
|
10
|
+
This package is experimental. It targets XState v6 alpha and Effect 4.
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
<!-- package name and peer dependencies from package.json -->
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install @xstate/effect@alpha xstate@alpha effect
|
|
17
|
+
npm install @xstate/effect@alpha xstate@alpha effect@^4
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## XState Effect: Quick start
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AsyncResult, Atom } from 'effect/
|
|
1
|
+
import { AsyncResult, Atom } from 'effect/reactivity';
|
|
2
2
|
import type { AnyActorLogic, ErrorFrom, EventFromLogic, SnapshotFrom } from 'xstate';
|
|
3
3
|
import { type EffectActorOptionsArgs } from "./createEffectActor.js";
|
|
4
4
|
import type { EffectActor } from "./effectActor.js";
|
|
@@ -8,7 +8,7 @@ import type { RequirementsFrom } from "./types.js";
|
|
|
8
8
|
export { NotReadyError } from "./errors.js";
|
|
9
9
|
/**
|
|
10
10
|
* Atoms that expose one actor to a reactive UI through
|
|
11
|
-
* `effect/
|
|
11
|
+
* `effect/reactivity`. Read them with the atom bindings for your
|
|
12
12
|
* framework, such as `@effect/atom-react`.
|
|
13
13
|
*/
|
|
14
14
|
export interface ActorAtoms<TLogic extends AnyActorLogic, ER = never> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cause } from 'effect';
|
|
2
|
-
import { Atom, AsyncResult } from 'effect/
|
|
2
|
+
import { Atom, AsyncResult } from 'effect/reactivity';
|
|
3
3
|
import { c as createEffectActor, N as NotReadyError, t as taggedState } from './state-14a1fecf.js';
|
|
4
4
|
export { N as NotReadyError } from './state-14a1fecf.js';
|
|
5
5
|
import 'xstate';
|
|
@@ -7,7 +7,7 @@ import 'xstate/durable';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Atoms that expose one actor to a reactive UI through
|
|
10
|
-
* `effect/
|
|
10
|
+
* `effect/reactivity`. Read them with the atom bindings for your
|
|
11
11
|
* framework, such as `@effect/atom-react`.
|
|
12
12
|
*/
|
|
13
13
|
|
package/dist/xstate-effect.js
CHANGED
|
@@ -658,6 +658,7 @@ function wrapActions(actions) {
|
|
|
658
658
|
for (const key of Object.keys(actions)) {
|
|
659
659
|
const action = actions[key];
|
|
660
660
|
wrapped[key] = args => {
|
|
661
|
+
// machine.provide can replace Effect actions with plain actions.
|
|
661
662
|
const result = action(args);
|
|
662
663
|
return Effect.isEffect(result) ? runHostedEffect(args.self, result, `action.${key}`) : result;
|
|
663
664
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xstate/effect",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Effect integration for XState",
|
|
6
6
|
"keywords": [
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"url": "https://github.com/statelyai/xstate/issues"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"effect": "^4.0.0
|
|
33
|
-
"xstate": "^6.0.0-alpha.
|
|
32
|
+
"effect": "^4.0.0",
|
|
33
|
+
"xstate": "^6.0.0-alpha.63"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"effect": "4.0.0
|
|
37
|
-
"xstate": "^6.0.0-alpha.
|
|
36
|
+
"effect": "4.0.0",
|
|
37
|
+
"xstate": "^6.0.0-alpha.63"
|
|
38
38
|
},
|
|
39
39
|
"preconstruct": {
|
|
40
40
|
"entrypoints": [
|