Tuesday, 6 October 2020

Unable to call the nested function with timer until met condition?

I have 2 methods that call some APIs:

  1. getData(param).
  2. getAnotherData(resp from get data).

The below method calls the first method:

this.service.getData(param).subscribe(res => {
    this.variable = res;

    // here based on the first response i will call the second api 

    this.service.getAnotherData(this.variable['data']).subscribe(res2 =>  

    // Here, I will get a response which will be either "started"
    // or not "started". If it's not "started", then I have to call
    // this API until I get "started" for up to 1 minute.
)})

How can I achieve this?



from Unable to call the nested function with timer until met condition?

No comments:

Post a Comment