I'm looking reading from RW book.
.retryWhen { errors in
return errors.enumerated().flatMap { (attempt, error) -> Observable<Int> in
if attempt >= maxAttempts - 1 {
return Observable.error(error)
}
return Observable<Int>.timer(Double(attempt + 1), scheduler:
MainScheduler.instance).take(1)
}
}
The timer isn’t taking a period
Variable so it’s firing once and is not repeating. So why is it doing take(1)
. I see that happening over a few times in the course of the book.