addOrUpdateWhere method
Returns a copy of this set by applying update
on each element that
fulfills the given predicate
, or adds the result of ifAbsent
to the
set if no element satisfying predicate
was found.
Implementation
ImmortalSet<T> addOrUpdateWhere(
bool Function(T value) predicate,
T Function(T value) update,
T Function() ifAbsent,
) =>
any(predicate) ? updateWhere(predicate, update) : add(ifAbsent());