Skip to content

Instantly share code, notes, and snippets.

@darrenmothersele
Last active December 19, 2018 18:31
Show Gist options
  • Select an option

  • Save darrenmothersele/63052d753d10d0ef536d9c98354b1bca to your computer and use it in GitHub Desktop.

Select an option

Save darrenmothersele/63052d753d10d0ef536d9c98354b1bca to your computer and use it in GitHub Desktop.
Per-User File Upload Quotas with Angular and Firebase Custom Auth Tokens
doFileUpload(uid, id, file) {
return new Observable(subscriber => {
const task = this.storage.upload(`${uid}/${id}`, file);
task.snapshotChanges()
.pipe(
finalize(() => {
subscriber.next({ done: true, id });
subscriber.complete();
})
)
.subscribe()
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment