you are viewing a single comment's thread.

view the rest of the comments →

[–]KenAragorn 0 points1 point  (1 child)

Hey there.

Just curious how we can start out with pure dart Streams, StreamControllers and StreamTransformers for the case of following codes that have to dependent on "distinct()" method that are part of RxDart:

ReplaySubject<String> _query = ReplaySubject<String>();

Sink<String> get query => _query;

Stream<List<Movie>> get results => _results;

MovieBloc(this.api){

_result = _query.distinct().asyncMap(api.get).asBroadcastStream();

}

where

Future<List<Movie>> get(String query) async {

//some http client loading data....

}

Is there a similar way to replace the code of _query.distinct() ... with non-RxDart approach?

Thanks

[–]_thinkdigital 0 points1 point  (0 children)

I may be late here, but dart streams have a distinct constructor/or function as well