I work with the latest Angular and Typescript and RxJS 5.
Angular is currently making RxJS necessary. I have been using C # mostly for over 10 years, and I'm very used to the Linq / Lambdas / free syntax, which I believe has become the foundation of Reactive.
I would like to make an Http call with an increase in the timeout value on restarting, but I had a problem with how to do this, and still keeping everything in the pipeline (without using an external state).
I get that I can do this, but it will just repeat using the same timeout value.
myHttpObservable.timeout(1000).retry(2);
The documentation for RxJS was poor in many places, and asking about it here only removed my question from existence, which is sad ... so I was forced to look at the source.
Is there a way to try again with an increase in the timeout duration each time so as to maintain state in the pipeline? In addition, I want the first timeout to be made on the first try.
At first I tried similar things, but realized the confusing retryWhen statement is not intended for what I want:
myHttpObservable.timeout(1000).retryWhen((theSubject: Observable<Error>) => { return aNewMyObservableCreatedinHere.timeout(2000); });
I know that I can do this using an external state, but I'm mostly looking for an elegant solution, which, I think, is what they are fighting for with a reactive programming style.