how do i make a chain of andThen() operator on an Completable ?
for example, the original code is this:
return Completable.complete()
.andThen(processdata("01"))
.andThen(processdata("02"))
.andThen(processdata("03"))
.andThen(processdata("04"))
.andThen(processdata("05"))
.andThen(processdata("06"))
.andThen(processdata("07")); //working
it worked perfectly!
but i dont want a "static" defined value, and tried to convert the code above into this:
Completable x = Completable.complete();
String[] allID = {"01","02","09"}
for (String Id : allID) {
x.andThen(processdata(Id));
}
return x; //not working
and it is not woking, as if nothing happened
and then i realized that :
Completable x = Completable.complete();
x.andThen(processdata("01"));
x.andThen(processdata("02"));
x.andThen(processdata("03"));
return x; //not working
is also not working ...
can anybody help how the proper way to chain a Completable in my case