core / type
NonSignal
A runtime type wrapper for plain values.
A runtime type wrapper for plain values.
NonSignal objects are used for runtime type discrimination in complex type scenarios where TypeScript's compile-time types are insufficient. They enable distinguishing between plain values and signalified objects at runtime.
Signature
export type NonSignal<T> = {
/** Runtime type discriminator for non-signal objects */
type: "non-signal";
/** The wrapped plain value */
get value(): T;
};
Type Parameters
- The type of value wrapped
Remarks
- Used with
MaybeSignaltypes to resolve ambiguity at runtime - Has a
type: "non-signal"property for runtime type checking - The
valueproperty holds the wrapped plain value
See Also
- Signal - For signal objects
- MaybeSignal - For union types that include signals
- getNonSignalObject - For creating NonSignal objects