Last active
December 19, 2018 18:31
-
-
Save darrenmothersele/63052d753d10d0ef536d9c98354b1bca to your computer and use it in GitHub Desktop.
Per-User File Upload Quotas with Angular and Firebase Custom Auth Tokens
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
| 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