on<T extends TdObject> method

Stream<T> on<T extends TdObject>()

Updates of type T only, e.g. client.on<UpdateNewMessage>().

Implementation

Stream<T> on<T extends TdObject>() =>
    _updates.stream.where((u) => u is T).cast<T>();