refactor(router): compatibility with typescript strict flag (#30993)
As part of FW-1265, the `@angular/router` package is made compatible with the TypeScript `--strict` flag. Read more about the strict flag [here](https://www.typescriptlang.org/docs/handbook/compiler-options.html) PR Close #30993
This commit is contained in:

committed by
Miško Hevery

parent
18f0c2f1d4
commit
ce9d0de840
@ -88,11 +88,14 @@ export function waitForMap<A, B>(
|
||||
}
|
||||
});
|
||||
|
||||
// Closure compiler has problem with using spread operator here. So just using Array.concat.
|
||||
return of .apply(null, waitHead.concat(waitTail)).pipe(concatAll(), lastValue(), map(() => res));
|
||||
// Closure compiler has problem with using spread operator here. So we use "Array.concat".
|
||||
// Note that we also need to cast the new promise because TypeScript cannot infer the type
|
||||
// when calling the "of" function through "Function.apply"
|
||||
return (of .apply(null, waitHead.concat(waitTail)) as Observable<Observable<B>>)
|
||||
.pipe(concatAll(), lastValue(), map(() => res));
|
||||
}
|
||||
|
||||
export function wrapIntoObservable<T>(value: T | NgModuleFactory<T>| Promise<T>| Observable<T>) {
|
||||
export function wrapIntoObservable<T>(value: T | Promise<T>| Observable<T>): Observable<T> {
|
||||
if (isObservable(value)) {
|
||||
return value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user