You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add fully typed shallow and deep history states. History targets restore schema-validated state values, support typed defaults before the first capture, require only the initializers needed by shallow restoration, preserve parallel configurations, and round-trip through snapshot encoding and decoding.
|`target.local`| Inside the source's nearest compound scope | Keeps the compound value, active ancestors, and unrelated parallel regions |
223
-
|`target.branch`| Anywhere under the source's active top-level root | Replaces the selected branch while keeping omitted active ancestor values and parallel regions |
224
-
|`target.full`| Any top-level root | Builds a complete active snapshot for the selected root |
|`target.local`| Inside the source's nearest compound scope | Keeps the compound value, active ancestors, and unrelated parallel regions |
287
+
|`target.branch`| Anywhere under the source's active top-level root | Replaces the selected branch while keeping omitted active ancestor values and parallel regions |
288
+
|`target.full`| Any top-level root | Builds a complete active snapshot for the selected root |
289
+
|`target.history`| A declared history pseudo-state | Restores its parent's remembered configuration or runs its typed default |
225
290
226
291
When `target.local` or `target.branch` enters an inactive nested parallel
227
292
state, its callback must select every region, just like `initial` and
@@ -404,9 +469,9 @@ restrictions and delivery guarantees are documented on that API.
404
469
405
470
## Current limits
406
471
407
-
History states and declarative first-class guards are not part of the current
408
-
API. Ordinary TypeScript conditions implement guards. Use `Machine.after` for a
409
-
cancellable state-scoped delayed event.
472
+
Declarative first-class guards are not part of the current API. Ordinary
473
+
TypeScript conditions implement guards. Use `Machine.after` for a cancellable
|`target.local`| The destination is inside the nearest compound scope containing the source | The compound value, active ancestors, and unrelated parallel regions |
209
-
|`target.branch`| The destination is elsewhere under the active top-level root | Omitted current ancestor values and parallel regions |
210
-
|`target.full`| The destination may be under any top-level root | Nothing is inferred for a newly selected root; build its complete active snapshot |
|`target.local`| The destination is inside the nearest compound scope containing the source | The compound value, active ancestors, and unrelated parallel regions |
269
+
|`target.branch`| The destination is elsewhere under the active top-level root | Omitted current ancestor values and parallel regions |
270
+
|`target.full`| The destination may be under any top-level root | Nothing is inferred for a newly selected root; build its complete active snapshot |
271
+
|`target.history`| The destination is a declared history pseudo-state | Its parent's remembered configuration, or its default before the first capture |
211
272
212
273
Entering an inactive parallel state through `target.local` or `target.branch`
213
274
requires a complete callback with one selection per region. A parallel state
@@ -611,10 +672,9 @@ a deeper statechart instead of casting away the diagnostic.
611
672
612
673
The current API does not include:
613
674
614
-
- history states;
615
675
- declarative first-class guards;
616
676
- a complete inspectable graph for arbitrary transition Effects.
617
677
618
678
Use ordinary TypeScript conditions for guards and `Machine.after` for
619
679
state-scoped timers. Do not invent undocumented state-node properties such as
0 commit comments