ConvertComputedImpl<T, U> constructor
ConvertComputedImpl<T, U> (
- WritableNode<
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
Implementation
ConvertComputedImpl(this.source,
{required this.decode, required this.encode, super.onDebug})
: super(
() => decode(source.value),
(value) => source.value = encode(value),
);