core / const
valueIsSignal
Checks whether a value is any signal (source or derived).
Checks whether a value is any signal (source or derived).
Signature
export const valueIsSignal = (input: MaybeSignal<any>): boolean =>
["source-signal", "derived-signal"].includes(input?.type);
Parameters
input: Any value to check
Returns
true if the value is a source or derived signal,
false otherwise
Remarks
- Returns true for both source and derived signals
- Returns false for non-signals and plain values
- Returns false for
nullandundefined
See Also
- SourceSignal - For source signal type
- DerivedSignal - For derived signal type
- Signal - For the signal union type