distinct method
Skips data events if they are equal to the previous data event.
It extends the current builder so that only distinct inputs
that pass the equals
clause will be kept for the EventHandler.
Implementation
EventSubscriptionBuilder<T> distinct([
bool Function(T previous, T next)? equals,
]) {
return _DistinctEventSubscriptionBuilder(
parent: this,
equals: equals ?? (prev, curr) => prev == curr,
);
}