I would like to repeat an API call which returns a Promise, conditionally using rxjs.
The API method receives an id which will be changed on every call by adding a counter prefix to it. The calls will be repeated until the data met some condition or the counter reach to a specific number X. How it can be done using rxjs?
API method:
fetchData(id):Promise<data>
try 1: fetchData(id)
try 2: fetchData(id_1)
try 3: fetchData(id_2)