Rxdart: Observable.concat() have unexpected result

Created on 23 Oct 2019  路  2Comments  路  Source: ReactiveX/rxdart

this is my code

import 'package:rxdart/rxdart.dart';

void main() async {
  print("main start");
  Observable.periodic(Duration(seconds: 1), (o) => print("${o + 1} second")).listen(null);
  var result = await testConcat().toList();
  print(result);
}

Observable testConcat() {
  return Observable.concat([
    Observable.timer(50, Duration(seconds: 5))
        .doOnListen(() => print("observable1 listened"))
        .doOnData((o) => print("observable1 get data")),
    Observable.timer(100, Duration(seconds: 3))
        .doOnListen(() => print("observable2 listened"))
        .doOnData((o) => print("observable2 get data")),
  ]);
}

and it is result

main start
observable1 listened
1 second
2 second
3 second
4 second
5 second
observable1 get data
observable2 listened
observable2 get data
[50, 100]

Most helpful comment

I believe it is TimerStream's bug. #358

All 2 comments

I believe it is TimerStream's bug. #358

thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brianegan picture brianegan  路  8Comments

egorikem picture egorikem  路  8Comments

frank06 picture frank06  路  3Comments

PritishSawant picture PritishSawant  路  3Comments

RomanSoviak picture RomanSoviak  路  3Comments