distinctMap<R> method
Create a reactive value that only updates when the mapped value changes
Implementation
RxComputed<R> distinctMap<R>(R Function(T) mapper) {
R? lastMapped;
return computed(() {
final newMapped = mapper(value);
if (lastMapped != newMapped) {
lastMapped = newMapped;
}
return lastMapped as R;
});
}