Commit 108ec3e
authored
feat: add .hasTag(), .matches(), and .broadcast() (#41)
- `.broadcast()`, to send an event to all of the machines, allowing you to not use `autoforward`
- `.hasTag()` will call against all the cached state objects (stopping at the first successful one)
- `.matches()` will call against all the cached state objects (stopping at the first successful one)
**NOTE**: Not a breaking change because the public API didn't meaningfully shift, but the internals of `xstate-component-tree` have been **significantly changed** in this release. Instead of invoking a new `ComponentTree` class for every child machine it now tracks them all without any need for recursion or new class instances. Should be a bit lighter at run-time as a result.1 parent f82158c commit 108ec3e
File tree
20 files changed
+1444
-385
lines changed- .github/workflows
- .vscode
- src
- tests
- api
- specimens
- util
20 files changed
+1444
-385
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
| |||
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
58 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
64 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
19 | 17 | | |
20 | 18 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
36 | 28 | | |
37 | | - | |
| 29 | + | |
38 | 30 | | |
0 commit comments