java - using toList operator on a neverending Observable -
the "neverending" observable emits parameter item user changes on ui.
depending on item need request. parameter item changes request should stopped , new 1 started.
parameterobservable .switchmap(this::search) // stop restart request new params .tolist() .subscribe(resultlist -> {/* something*/});
the problem here that, tolist operator waits parameterobservable complete. not happen.
to make tolist work this:
parameterobservable .subscribe(params -> search(params).tolist() .subscribe(/* */) );
but switchmap missing.
how can achieve this?
how this:
parameterobservable .switchmap(params -> search(params).tolist()) .subscribe(resultlist -> {/* something*/});
Comments
Post a Comment