'Polling redux epic until condition is met

Hello awesome community,

I am working on a polling redux epic that should keep firing an action until a condition is met. This condition is based on the response of the action.

It turns out that polling is possible and I should add a cancellation action: takeUntil(actions$.pipe(ofType(CANCEL))). However, I am trying to implement the following with no cancel action:

      timer(0, x * 1000).pipe(
        takeUntil(response.element.available === true),
......

This is firing the error: ```Argument of type 'boolean' is not assignable to parameter of type 'ObservableInput'````

Is what I am looking to implement not possible? (Does it break the redux logic?)?

Thank you in advance for your help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source