Repository navigation
Version 0.18.1
Pre-release
Pre-release
What's Changed
Added
- Memo
watched(invalidate)option:createMemo(fn, { watched })accepts a lazy lifecycle callback that receives aninvalidatefunction. Callinginvalidate()marks the memo dirty and triggers re-evaluation. The callback is invoked on first sink attachment and cleaned up when the last sink detaches. This enables patterns like DOM observation where a memo re-derives its value in response to external events (e.g., MutationObserver) without needing a separate Sensor. - Task
watched(invalidate)option: Same pattern as Memo. Callinginvalidate()aborts any in-flight computation and triggers re-execution. CollectionChanges<T>type: New typed interface for collection mutations withadd?: T[],change?: T[],remove?: T[]arrays. Replaces the untypedDiffResultrecords previously used byCollectionCallback.SensorOptions<T>type: Dedicated options type forcreateSensor, extendingSignalOptions<T>with optionalvalue.CollectionChangesexport from public API (index.ts).SensorOptionsexport from public API (index.ts).
Changed
createSensorparameter renamed:start→watchedfor consistency with Store/List lifecycle terminology.createSensoroptions type:ComputedOptions<T>→SensorOptions<T>. This decouples Sensor options fromComputedOptions, which now carries thewatched(invalidate)field for Memo/Task.createCollectionparameter renamed:start→watchedfor consistency.CollectionCallbackis now generic:CollectionCallback→CollectionCallback<T>. TheapplyChangesparameter acceptsCollectionChanges<T>instead ofDiffResult.CollectionOptions.createItemsignature:(key: string, value: T) => Signal<T>→(value: T) => Signal<T>. Key generation is now handled internally.KeyConfig<T>return type relaxed: Key functions may now returnstring | undefined. Returningundefinedfalls back to synthetic key generation.
Removed
DiffResultremoved from public API: No longer re-exported fromindex.ts. The type remains available fromsrc/nodes/list.tsfor internal use but is superseded byCollectionChanges<T>for collection mutations.
Full Changelog: v0.18.0...v0.18.1