Skip to content

Instantly share code, notes, and snippets.

@darrenmothersele
Created December 19, 2018 18:30
Show Gist options
  • Save darrenmothersele/59b0d3145bb6dcefaf0e0ff320c5e816 to your computer and use it in GitHub Desktop.
Save darrenmothersele/59b0d3145bb6dcefaf0e0ff320c5e816 to your computer and use it in GitHub Desktop.
upload-with-get-quota.ts
// 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