race()
Mirrors the first source that emits a value; unsubscribes from the losers and follows the winner thereafter.
Signature
ts
function race<T>(...sources: Store<T>[]): Store<T | undefined>Parameters
| Parameter | Type | Description |
|---|---|---|
sources | Store<T>[] | Competing Store<T> inputs (fair start via deferred wiring). |
Returns
Store<T | undefined> — Tier 2.
Options / Behavior Details
- Empty: Completes immediately if
sourcesis empty. - Errors: If a source errors before any DATA, the error propagates.