Skip to content

Commit

Permalink
Shouldnt be using add like that w/rxjs 7
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdaniels committed Aug 25, 2021
1 parent d41d3e4 commit d2568bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion storage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ export function uploadBytesResumable(
): Observable<UploadTaskSnapshot> {
return new Observable<UploadTaskSnapshot>(subscriber => {
const task = _uploadBytesResumable(ref, data, metadata);
return fromTask(task).subscribe(subscriber).add(task.cancel);
const subscription = fromTask(task).subscribe(subscriber);
return function unsubscribe() {
subscription.unsubscribe();
task.cancel();
};
}).pipe(shareReplay({ bufferSize: 1, refCount: true }));
}

Expand Down

0 comments on commit d2568bb

Please sign in to comment.