@@ -189,12 +189,16 @@ export interface MemoOptions<T> {
189189 /** When true, the owner is invisible to the ID scheme -- inherits parent ID and doesn't consume a childCount slot */
190190 transparent ?: boolean ;
191191 /**
192- * Custom equality function, or `false` to always notify subscribers.
192+ * Custom equality function, or `false` to always notify subscribers, or
193+ * `true` to never notify them — the cached value is frozen at the first
194+ * computed result and downstream consumers see a constant. The compute
195+ * function still re-runs when its dependencies change, but the new value
196+ * is discarded by the equality check (backed by `isAlwaysEqual`).
197+ *
193198 * Defaults to reference equality (`isEqual`). Pass a comparator (e.g.
194- * `(a, b) => a.id === b.id`) for value-based equality, or `false` to
195- * notify on every recompute regardless of equality.
199+ * `(a, b) => a.id === b.id`) for value-based equality.
196200 */
197- equals ?: false | ( ( prev : T , next : T ) => boolean ) ;
201+ equals ?: true | false | ( ( prev : T , next : T ) => boolean ) ;
198202 /** Callback invoked when the computed loses all subscribers */
199203 unobserved ?: ( ) => void ;
200204 /**
@@ -223,7 +227,7 @@ export type NoInfer<T extends any> = [T][T extends any ? 0 : never];
223227 * // Plain signal
224228 * const [state, setState] = createSignal<T>(value, options?: SignalOptions<T>);
225229 * // Writable memo (function overload)
226- * const [state, setState] = createSignal<T>(fn, initialValue?, options?: SignalOptions<T> & MemoOptions<T>);
230+ * const [state, setState] = createSignal<T>(fn, initialValue?, options?: Omit< SignalOptions<T>, "equals" > & MemoOptions<T>);
227231 * ```
228232 * @param value initial value of the state; if empty, the state's type will automatically extended with undefined
229233 * @param options optional object with a name for debugging purposes and equals, a comparator function for the previous and next value to allow fine-grained control over the reactivity
@@ -253,11 +257,11 @@ export function createSignal<T>(): Signal<T | undefined>;
253257export function createSignal < T > ( value : Exclude < T , Function > , options ?: SignalOptions < T > ) : Signal < T > ;
254258export function createSignal < T > (
255259 fn : ComputeFunction < T > ,
256- options ?: SignalOptions < T > & MemoOptions < T >
260+ options ?: Omit < SignalOptions < T > , "equals" > & MemoOptions < T >
257261) : Signal < T > ;
258262export function createSignal < T > (
259263 first ?: T | ComputeFunction < T > ,
260- second ?: SignalOptions < T > & MemoOptions < T >
264+ second ?: Omit < SignalOptions < T > , "equals" > & MemoOptions < T >
261265) : Signal < T | undefined > {
262266 if ( typeof first === "function" ) {
263267 const node = computed < T > ( first as any , second as any ) ;
@@ -594,7 +598,7 @@ export function resolve<T>(fn: () => T): Promise<T> {
594598 * // Plain optimistic signal
595599 * const [state, setState] = createOptimistic<T>(value, options?: SignalOptions<T>);
596600 * // Writable optimistic memo (function overload)
597- * const [state, setState] = createOptimistic<T>(fn, options?: SignalOptions<T> & MemoOptions<T>);
601+ * const [state, setState] = createOptimistic<T>(fn, options?: Omit< SignalOptions<T>, "equals" > & MemoOptions<T>);
598602 * ```
599603 * @param value initial value of the signal; if empty, the signal's type will automatically extended with undefined
600604 * @param options optional object with a name for debugging purposes and equals, a comparator function for the previous and next value to allow fine-grained control over the reactivity
@@ -622,11 +626,11 @@ export function createOptimistic<T>(
622626) : Signal < T > ;
623627export function createOptimistic < T > (
624628 fn : ComputeFunction < T > ,
625- options ?: SignalOptions < T > & MemoOptions < T >
629+ options ?: Omit < SignalOptions < T > , "equals" > & MemoOptions < T >
626630) : Signal < T > ;
627631export function createOptimistic < T > (
628632 first ?: T | ComputeFunction < T > ,
629- second ?: SignalOptions < T > & MemoOptions < T >
633+ second ?: Omit < SignalOptions < T > , "equals" > & MemoOptions < T >
630634) : Signal < T | undefined > {
631635 if ( typeof first === "function" ) {
632636 const node = optimisticComputed < T > ( first as any , second as any ) ;
0 commit comments