add method

  1. @override
void add(
  1. T data
)
override

Implementation

@override
void add(T data) {
  if (_isInProgress) {
    throw Exception('Batch confirming in progress');
  }

  _data.add(data);
  delegate.onAddDataToBatch(data);

  if (_timer != null) {
    _clearTimer();
  }

  _timer = Timer(
    delegate.durationIdleBeforeConfirm,
    _onConfirm,
  );
}