core / const

valueIsSignal

Checks whether a value is any signal (source or derived).

Source: src/_core/utils/type-checkers.ts

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 null and undefined

See Also

  • SourceSignal - For source signal type
  • DerivedSignal - For derived signal type
  • Signal - For the signal union type