ConvertComputed<T, U> constructor
ConvertComputed<T, U> (
- Signal<
U> source, { - required T decode(
- U value
- required U encode(
- T value
- JoltDebugFn? onDebug,
Creates a type-converting computed signal.
Parameters:
source: The source signal to convert fromdecode: Function to convert from source type to target typeencode: Function to convert from target type to source typeonDebug: Optional debug callback for reactive system debugging
Example:
final convertComputed = ConvertComputed(
count,
decode: (int v) => v.toString(),
encode: (String v) => int.parse(v),
);
Implementation
factory ConvertComputed(Signal<U> source,
{required T Function(U value) decode,
required U Function(T value) encode,
JoltDebugFn? onDebug}) = ConvertComputedImpl<T, U>;