Wednesday 15 July 2015

rx java - Placeholder for Observable? -



rx java - Placeholder for Observable? -

lets have 2 observables , b. emits true when service connected program. b emits true if service started, else false.

i want combine , b using combinelatest , take appropriate action.

the problem b not available until have connected service. question if can have observable-wrapper och placeholder b until b available? when b available wrapper should emit values coming b.

i came simple solution.

i created subject c, this

behaviorsubject<boolean> c = behaviorsubject.create(false);

by doing able this

observable.combinelatest(a, c, bla bla....

then when b become available do

b.subcribe(c);

rx-java

No comments:

Post a Comment