Rxjs: Rx.Observable.ajax onProgress only set for Upload

Created on 11 Sep 2017  路  2Comments  路  Source: ReactiveX/rxjs

Hi there,

I hadn't been able to make progressSubscriber.next to fire on a Rx.Observable.ajax instance, when downloading. Checking the code and the log I found that you set onprogress for the upload but you removed the one for download.

As window.XDomainRequest is only available for IE 8 & 9, then on modern browsers onprogress is not assigned.

https://github.com/ReactiveX/rxjs/blob/7bb8280181bf1d5b0a2d3338ede8bea5e30f64c7/src/observable/dom/AjaxObservable.ts#L332-L336

Did you avoid setting xhr.onprogress = xhrProgress for any specific reason? Or, Should it be there next to xhr.upload.onprogress = xhrProgress ?

Thanks
SntsDev

Help Wanted bug

Most helpful comment

It has been more than a year now. What is status of this?

All 2 comments

It seems to me that AjaxObservable needs to make a distinction between upload progress and download progress. You can get progress events by adding the line xhr.onprogress = xhrProgress, but you can't really tell the different between upload progress and download progress.

Would it make sense to split the progressSubscriber property into uploadProgressSubscriber and downloadProgressSubscriber? the existing progressSubscriber property could be deprecated, and left with the current behaviour to maintain compatibility.

It has been more than a year now. What is status of this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OliverJAsh picture OliverJAsh  路  3Comments

Zzzen picture Zzzen  路  3Comments

chalin picture chalin  路  4Comments

unao picture unao  路  4Comments

jakovljevic-mladen picture jakovljevic-mladen  路  3Comments