Version 1.1.1
What's Changed
Added
- Single-signal overload for
match():match(signal, handlers)now accepts a bare signal (not wrapped in an array). Theokhandler receives the resolved value directly as(value: T), anderrreceives a singleErrorrather thanreadonly Error[]. The existing tuple form is unchanged. This eliminates the boilerplate of wrapping a single source in[source], destructuringvalues[0]inok, and unwrappingerrors[0]!inerr. SingleMatchHandlers<T>type: New exported type that describes the handler object for the single-signal overload. Counterpart to the existingMatchHandlers<T>for tuple usage.
Changed
- Async handler documentation: Added
@remarksto thematch()JSDoc and an expanded section inREADME.mdclarifying that asyncok/errhandlers are intended for external side effects only (logging, DOM writes, analytics). Any async work that needs to drive reactive state should use aTasknode, which receives anAbortSignaland is auto-cancelled on re-run. Documents the known limitation that rejected async handlers from stale (superseded) runs still callerr, since the library cannot cancel operations it did not initiate.
Fixed
Slot.set()now forwards through Slot-to-Slot chains: Previously, writing to a Slot whose backing signal was itself a Slot threwReadonlySignalErrorbecauseisMutableSignaldoes not includeSlot(by design — a Slot wrapping a read-only signal is not mutable).set()now recursively delegates to the next Slot in the chain, allowing the terminal backing signal to determine write permissions. Chains of arbitrary depth are resolved correctly.
Full Changelog: v1.0.2...v1.1.1