fix(common): weaken AsyncPipe transform signature (#22169)

The AsyncPipe type signature was changed to allow
deferred creation of promises and observalbes that
is supported by the implementation by allowing
`Promise<T>|null|undefined` and by allowing
`Observable<T>|null|undefined`.

PR Close #22169
This commit is contained in:
Chuck Jazdzewski
2018-02-12 09:06:17 -08:00
committed by Miško Hevery
parent b333919722
commit be59c3a98c
3 changed files with 38 additions and 6 deletions

View File

@ -85,8 +85,8 @@ export class AsyncPipe implements OnDestroy, PipeTransform {
transform<T>(obj: null): null;
transform<T>(obj: undefined): undefined;
transform<T>(obj: Observable<T>): T|null;
transform<T>(obj: Promise<T>): T|null;
transform<T>(obj: Observable<T>|null|undefined): T|null;
transform<T>(obj: Promise<T>|null|undefined): T|null;
transform(obj: Observable<any>|Promise<any>|null|undefined): any {
if (!this._obj) {
if (obj) {