Skip to content

Commit 79c77c4

Browse files
committed
Add .stop() method
1 parent f1148a0 commit 79c77c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

readme.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ The result of any `entry()` or `exit()` messages.
3636

3737
Sends an event to the machine, transitioning if the event was recognised. Unrecognised events are ignored.
3838

39+
### `.stop()`
40+
41+
Cleans up the machine.
42+
3943

4044
## Messages
4145

@@ -63,7 +67,7 @@ Immediately transitions to the target state, if previous `cond()` did not pass.
6367

6468
Listens to an `EventTarget` — for example, an HTMLElement like a button.
6569

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.
6771

6872
```ts
6973
function ButtonClickListener(button: HTMLButtonElement) {

0 commit comments

Comments
 (0)