⏳ Async Operations
Module:
async/*| Operators: 8
Control timing with delays, debouncing, retries, and timeouts.
Operator Reference
async/delay
Delay · 1 argument · returns void
· ⚠️ has side effects
Wait for specified milliseconds
| Parameter | Type | Description |
|---|---|---|
ms | number | Milliseconds to wait |
["async/delay", 2000] // Wait 2 seconds
async/timeout
Timeout · 2 arguments · returns any
· ⚠️ has side effects
Add timeout to an effect
| Parameter | Type | Description |
|---|---|---|
effect | expression | Effect to execute |
ms | number | Timeout in milliseconds |
["async/timeout", ["call", "api", "fetchData"], 5000]
async/debounce
Debounce · 2 arguments · returns void
· ⚠️ has side effects
Debounce an event (wait for pause in events)
| Parameter | Type | Description |
|---|---|---|
event | string | Event name to emit |
ms | number | Debounce delay in milliseconds |
["async/debounce", "SEARCH", 300]