effect-machine 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/actor.ts +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect-machine",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cevr/effect-machine.git"
package/src/actor.ts CHANGED
@@ -520,8 +520,10 @@ export const createActor = Effect.fn("effect-machine.actor.spawn")(function* <
520
520
  return buildActorRefCore(id, machine, stateRef, eventQueue, stoppedRef, listeners, stop);
521
521
  }
522
522
 
523
- // Start the event loop
524
- const loopFiber = yield* Effect.fork(
523
+ // Start the event loop — use forkScoped so the event loop fiber's lifetime
524
+ // is tied to the provided Scope, not the calling fiber. This prevents the
525
+ // event loop from being interrupted when a transient caller completes.
526
+ const loopFiber = yield* Effect.forkScoped(
525
527
  eventLoop(
526
528
  machine,
527
529
  stateRef,