You could use `toPromise` that is defined above.