While reviewing a project code recently, I came across some declarations in TypeScript that were unfamiliar to me:
export interface SomeInterface<T> {
<R>(paths: string[]): Observable<R>;
<R>(Fn: (state: T) => R): Observable<R>;
}
I am curious about the syntax in TS using <R>
before a function typing like:
(paths: string[]) : Observable<R>
. Does anyone have any insights on this? Any clues would be greatly appreciated. Thank you.