|
3 | 3 | <p>Composable State Machines using Generator Functions</p> |
4 | 4 | <div> |
5 | 5 | <a href="https://bundlephobia.com/result?p=yieldmachine"> |
6 | | - <img src="https://badgen.net/bundlephobia/minzip/yieldmachine@0.4.1" alt="minified and gzipped size"> |
7 | | - <img src="https://badgen.net/bundlephobia/min/yieldmachine@0.4.1" alt="minified size"> |
8 | | - <img src="https://badgen.net/bundlephobia/dependency-count/yieldmachine@0.4.1" alt="zero dependencies"> |
| 6 | + <img src="https://badgen.net/bundlephobia/minzip/yieldmachine@0.4.9" alt="minified and gzipped size"> |
| 7 | + <img src="https://badgen.net/bundlephobia/min/yieldmachine@0.4.9" alt="minified size"> |
| 8 | + <img src="https://badgen.net/bundlephobia/dependency-count/yieldmachine@0.4.9" alt="zero dependencies"> |
9 | 9 | </a> |
10 | 10 | </div> |
11 | 11 | </div> |
12 | 12 |
|
13 | | -## Overview |
| 13 | +## Goals |
14 | 14 |
|
15 | | -- Define state machine components using generators functions. |
16 | 15 | - States can be reused. |
17 | 16 | - Nest machines inside one another. |
18 | | -- Use native JavaScript features such as Promise, AbortSignal, and EventTarget. |
19 | | -- Conform various stateful things such as offline status, promises, fetch, IntersectionObserver, ResizeObserver, window.location. Manage these things in a consistent way with a consistent interface. |
| 17 | +- Interops with native JavaScript & browser features such as Promise, AbortSignal, and EventTarget. |
| 18 | +- Consistently use built-in browser features such as offline status, promises, fetch, IntersectionObserver, ResizeObserver, window.location. Manage these things in a consistent way with a consistent interface. |
20 | 19 |
|
21 | | -### Problems |
| 20 | +### Problems that state machines solve |
22 | 21 |
|
23 | | -+ Making sure my code is 100% robust and doesn't fall into inconsistent states is hard. |
| 22 | +- Making sure my code is 100% robust and doesn't fall into inconsistent states is hard. |
24 | 23 | - It's easy to forget about error handling. |
25 | 24 | - Built-in browser features (such as InteractionObserver) are powerful but a pain to manage correctly. |
26 | 25 | - Managing various flavors of state is hard: the current URL, local storage, focused element, fetch response, caches, offline/online. |
|
0 commit comments