Skip to content

Version 1.1.1

Choose a tag to compare

@estherbrunner estherbrunner released this 11 Apr 11:08
· 169 commits to main since this release
388f29b

What's Changed

Added

  • Single-signal overload for match(): match(signal, handlers) now accepts a bare signal (not wrapped in an array). The ok handler receives the resolved value directly as (value: T), and err receives a single Error rather than readonly Error[]. The existing tuple form is unchanged. This eliminates the boilerplate of wrapping a single source in [source], destructuring values[0] in ok, and unwrapping errors[0]! in err.
  • SingleMatchHandlers<T> type: New exported type that describes the handler object for the single-signal overload. Counterpart to the existing MatchHandlers<T> for tuple usage.

Changed

  • Async handler documentation: Added @remarks to the match() JSDoc and an expanded section in README.md clarifying that async ok/err handlers are intended for external side effects only (logging, DOM writes, analytics). Any async work that needs to drive reactive state should use a Task node, which receives an AbortSignal and is auto-cancelled on re-run. Documents the known limitation that rejected async handlers from stale (superseded) runs still call err, 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 threw ReadonlySignalError because isMutableSignal does not include Slot (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