@typeonce/effect-machine 0.45.0 → 0.46.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/Machine.d.ts +10 -4
- package/dist/Machine.d.ts.map +1 -1
- package/dist/Machine.js.map +1 -1
- package/dist/internal/machine/invocation.d.ts.map +1 -1
- package/dist/internal/machine/invocation.js +7 -2
- package/dist/internal/machine/invocation.js.map +1 -1
- package/dist/internal/machine/runtimeCompiled.d.ts.map +1 -1
- package/dist/internal/machine/runtimeCompiled.js +6 -1
- package/dist/internal/machine/runtimeCompiled.js.map +1 -1
- package/dist/internal/machine/runtimeGeneric.d.ts.map +1 -1
- package/dist/internal/machine/runtimeGeneric.js +5 -3
- package/dist/internal/machine/runtimeGeneric.js.map +1 -1
- package/docs/agent-guide.md +20 -0
- package/docs/effect-atom-react.md +7 -0
- package/package.json +1 -1
- package/src/Machine.ts +10 -4
- package/src/internal/machine/invocation.ts +37 -28
- package/src/internal/machine/runtimeCompiled.ts +5 -1
- package/src/internal/machine/runtimeGeneric.ts +5 -3
package/dist/Machine.d.ts
CHANGED
|
@@ -1163,9 +1163,14 @@ export interface Prepared<out State, in Event, out Error, out Output, out Emitte
|
|
|
1163
1163
|
* `send` reports whether an event was accepted for delivery. A running
|
|
1164
1164
|
* machine reference is local, so an idle machine processes an accepted event
|
|
1165
1165
|
* in the sender's turn: work that completes without suspending is reflected
|
|
1166
|
-
* by `snapshot` when `send` returns. Work
|
|
1167
|
-
*
|
|
1168
|
-
*
|
|
1166
|
+
* by `snapshot` when `send` returns. Work invoked by an entered state also
|
|
1167
|
+
* starts in the sender's turn and runs until it first suspends, so browser
|
|
1168
|
+
* APIs that require user activation, such as `window.open`, can run in the
|
|
1169
|
+
* first step of an invoked Effect. Work that suspends continues in the
|
|
1170
|
+
* background, and its outcome is handled in a later turn, even when the work
|
|
1171
|
+
* completes without suspending, so the entered state is always observed
|
|
1172
|
+
* before the outcome leaves it. An event sent while the machine is processing
|
|
1173
|
+
* is queued behind the current work. `changes` subscribers receive every committed
|
|
1169
1174
|
* snapshot in order once the sender yields, with consecutive sends delivered
|
|
1170
1175
|
* together. This guarantee belongs to `MachineRef`; a `MachineTarget` only
|
|
1171
1176
|
* promises delivery. Errors that occur while processing an accepted event are
|
|
@@ -1198,7 +1203,8 @@ export interface MachineRef<out State, in Event, out Error = never, out Output =
|
|
|
1198
1203
|
/**
|
|
1199
1204
|
* Accepts an event for processing by this local machine. An idle machine
|
|
1200
1205
|
* processes it in the sender's turn until the work first suspends, so
|
|
1201
|
-
* `snapshot` reflects it when `send` returns.
|
|
1206
|
+
* `snapshot` reflects it when `send` returns. Work invoked by an entered
|
|
1207
|
+
* state starts in the same turn; its outcome is handled in a later turn.
|
|
1202
1208
|
*/
|
|
1203
1209
|
readonly send: (event: Event) => Effect.Effect<void, StoppedError>;
|
|
1204
1210
|
/**
|