UNPKG

@modular-forms/react

Version:

The modular and type-safe form library for React

12 lines (11 loc) 278 B
/** * It reads the value of a signal via .value or .peek(). * * @param signal The signal to be read. * @param peek Whether to subscribe. * * @returns The value of the signal. */ export function readSignal(signal, peek) { return peek ? signal.peek() : signal.value; }