I came across this method signature:
export function retry<T>(this: Observable<T>, count: number = -1): Observable<T> {
return higherOrder(count)(this) as Observable<T>;
}
The first parameter is this
and it is typed as Observable<T>
. I noticed that having this
as an argument may seem incorrect, but the compiler accepts this syntax and I have seen this pattern used a few times before. Can someone explain what its purpose is?