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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -