effect-machine 0.3.0 → 0.3.1

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 +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect-machine",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cevr/effect-machine.git"
package/src/actor.ts CHANGED
@@ -84,6 +84,13 @@ export interface ActorRef<State extends { readonly _tag: string }, Event> {
84
84
  */
85
85
  readonly stop: Effect.Effect<void>;
86
86
 
87
+ /**
88
+ * Stop the actor (fire-and-forget).
89
+ * Signals graceful shutdown without waiting for completion.
90
+ * Use when stopping from sync contexts (e.g. framework cleanup hooks).
91
+ */
92
+ readonly stopSync: () => void;
93
+
87
94
  /**
88
95
  * Get current state snapshot (Effect)
89
96
  */
@@ -422,6 +429,7 @@ export const buildActorRefCore = <
422
429
  send,
423
430
  state: stateRef,
424
431
  stop,
432
+ stopSync: () => Effect.runFork(stop),
425
433
  snapshot,
426
434
  snapshotSync: () => Effect.runSync(SubscriptionRef.get(stateRef)),
427
435
  matches,