Please tell me how ReactiveX can serialize asynchronous communication and synthesize results.
I use rxswift, but I don't tag any specific language because I think it's the same concept.
Currently, functions that return various asynchronous communications as Observable are implemented as follows:
Please tell me how to use them
func requestApiA()->Observable<ResponseA>{/*omitted*/}
func requestApiB(parameterA:ResponseA)->Observable<ResponseB>{/*omitted*/}
US>func requestApiC (parameterA:ResponseA, parameterB:ResponseB) - >Observable<ResponseC>{/*omitted*/}
Each Observable responds as returning results only once.
let request=requestApiA().flatMap{resAin
requestApiB(parameterA:resA).flatMap{resBin)
requestApiC(parameterA:resA, parameterB:resB)
}
}
You can build Observable like this.
The rest will be done as soon as you subscribe.
request.subscribe(...)
© 2024 OneMinuteCode. All rights reserved.