map<R> method

Reactive<R> map<R>(
  1. R mapper(
    1. T
    )
)

Maps this reactive value to another reactive value.

Implementation

Reactive<R> map<R>(R Function(T) mapper) {
  final mapped = Reactive<R>(mapper(value));
  listen((newValue) {
    mapped.value = mapper(newValue);
  });
  return mapped;
}