Rxdart: CombineLatestStream.list and connectionState

Created on 12 May 2020  路  3Comments  路  Source: ReactiveX/rxdart

I use CombineLatestStream.list to combine a set of ValueStream and observe that the AsyncSnapshot.connectionState changes alot between waiting and active.

Should it not show waiting untill values from all streams are present, and then change to active?

Most helpful comment

Pass initialData into StreamBuilder

final stream$ = Rx.combineLatest([...]).shareValueSeeded(seeded);
StreamBuilder(
  stream: stream$,
  initialData: stream$.value,
  builder: ...
)

All 3 comments

Pass initialData into StreamBuilder

final stream$ = Rx.combineLatest([...]).shareValueSeeded(seeded);
StreamBuilder(
  stream: stream$,
  initialData: stream$.value,
  builder: ...
)

Ok, thanks. I will try that later.

But i could just rather check for snapshot.data != null ?

Snapshot.data ( a list ) is only not null when it has values from all streams?

Just shareValueSeeded(null), and in builder

List<...> data = snapshot.data;
if (data == null) return Loading();
return ListView(data);
Was this page helpful?
0 / 5 - 0 ratings

Related issues

frank06 picture frank06  路  3Comments

RomanSoviak picture RomanSoviak  路  3Comments

x4080 picture x4080  路  4Comments

egorikem picture egorikem  路  8Comments

rmargolinross picture rmargolinross  路  7Comments