stream property

Stream get stream

A stream of events from the server.

Implementation

static Stream<MercuryResponse> get stream {
  if (currentUser.id != _currentStreamUserId) {
    _currentStreamUserId = currentUser.id;
    _stream?.cancel();
    MercuryRequest req = MercuryRequest(user: currentUser);
    _stream = _client.receive(req);
    _broadcast = _stream?.asBroadcastStream();
  }
  return _broadcast ?? Stream.empty();
}