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
Copy file name to clipboardExpand all lines: readme.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,10 @@ The result of any `entry()` or `exit()` messages.
36
36
37
37
Sends an event to the machine, transitioning if the event was recognised. Unrecognised events are ignored.
38
38
39
+
### `.stop()`
40
+
41
+
Cleans up the machine.
42
+
39
43
40
44
## Messages
41
45
@@ -63,7 +67,7 @@ Immediately transitions to the target state, if previous `cond()` did not pass.
63
67
64
68
Listens to an `EventTarget` — for example, an HTMLElement like a button.
65
69
66
-
Uses [`.addEventListener()`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) to listen to the event. The listener is removed when transitioning to a different state, so no extra clean up is necessary.
70
+
Uses [`.addEventListener()`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) to listen to the event. The listener is removed when transitioning to a different state or when the machine is stopped, so no extra clean up is necessary.
67
71
68
72
```ts
69
73
function ButtonClickListener(button:HTMLButtonElement) {
0 commit comments