add method

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

Send an item to the subscriptions.

Implementation

@override
void add(T item) {
  if (!hasListener) return;
  if (_isSync) {
    _sendItem(_subscriptions, item);
  } else {
    /// Only schedule a single micro-task for async streams.
    if (_itemsToSend == null) {
      _itemsToSend = [];
      scheduleMicrotask(_sendAsync);
    }
    _itemsToSend!.add(item);
  }
}