Created
December 19, 2018 18:30
-
-
Save darrenmothersele/59b0d3145bb6dcefaf0e0ff320c5e816 to your computer and use it in GitHub Desktop.
upload-with-get-quota.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Three observables | |
| const getQuota$ = this.functions.httpsCallable('getQuotaToken')({ id }); | |
| const signIn$ = token => this.userService.signInWithToken(token); | |
| const doUpload$ = this.doFileUpload(userId, id, file); | |
| // Combine | |
| getQuota$.pipe( | |
| concatMap(({ token }) => signIn$(token)), | |
| concatMap(() => doUpload$) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment