processDiffs method

void processDiffs({
  1. required Future<void> added(
    1. T item
    ),
  2. required Future<void> removed(
    1. T item
    ),
  3. required DspReg disposers,
})

Implementation

void processDiffs({
  required Future<void> Function(T item) added,
  required Future<void> Function(T item) removed,
  required DspReg disposers,
}) async {
  final listening = diffs.asyncListen((diff) async {
    await Future.wait([
      ...diff.added.map(added),
      ...diff.removed.map(removed),
    ]);
  });

  disposers.add(listening.cancel);
}