Recipes
Each recipe links to a corresponding minimal example. The fastest path is to look at the example first, then confirm the details in Kumiki Specification.
State
| What you want to do | Example |
|---|---|
| Counter-like state and updates | 01-slot-and-reducer |
| Constrain a value's range or format | 02-nominal-type |
| Immutably update a record | 04-record-and-copy |
| Pure helper functions | 05-pure-fn |
Collections
| What you want to do | Example |
|---|---|
| map / filter / render a list | 07-list |
| Add, get, remove on a Map | 08-map |
| Toggle with a Set | 09-set |
| Handle an optional value (maybe present) | 10-option |
| Represent success or failure | 22-result |
| Date-time and duration | 11-time-and-duration |
UI
| What you want to do | Example |
|---|---|
| Lay out in rows, columns, or grids | 12-layout |
| Two-way binding with an input field | 13-text-input-bind |
| Dropdown | 14-select |
| Checkbox | 15-checkbox |
| Show conditionally | 16-conditional-ui |
| Theme switching | 17-theme |
App Level
| What you want to do | Example |
|---|---|
| Routing, parameters, and 404 | 18-routing |
| Fetch data over HTTP | 19-effect-http |
| Persist to localStorage | 20-effect-storage |
| Periodic execution (timer) | 21-timer |
| Work on startup or route transition | 23-lifecycle-route-enter |
See Combinations in Real Apps
- CRUD + Map + Option: 04-issue-tracker
- Nested data + Kanban + theme: 05-project-management