addListener method

void addListener(
  1. MiniSubscription<T> data
)

Inserts a MiniSubscription at the end of the list.

Implementation

void addListener(MiniSubscription<T> data) {
  final Node<MiniSubscription<T>> newNode =
      Node<MiniSubscription<T>>(data: data);

  if (isEmpty) {
    _head = newNode;
  } else {
    Node<MiniSubscription<T>> currentNode = _head!;
    while (currentNode.next != null) {
      currentNode = currentNode.next!;
    }
    currentNode.next = newNode;
  }
}