How to repeat a promise conditionally using rxjs

Discussão em 'Angular' iniciado por Asi, Dezembro 20, 2024.

  1. Asi

    Asi Guest

    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)

    Continue reading...

Compartilhe esta Página