You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
Currently, the callback is called with 3 parameters: callback(result, status, xhr). This is supplied by the parseReq function.
However, this is only done for the success, error & always methods (and by extension, the callback passed to the initial call). The actual promise returned still resolves to just the raw xhr object.
I think it would make more sense to pipe the promise directly into parseReq:
The only issue here is that sadly most current promise implementations do not support multi-value fulfillment. We can either pass an array to then, or just pass the parsed result.
The text was updated successfully, but these errors were encountered:
Actually, after giving this more thought, I don't think it really makes any sense to fulfill with an array.
So instead, here's what I propose:
We keep the current callbacks as is, but we only pass the result to then. I think it makes way more sense than passing it the xhr directly. 99% of the time the result is really all you want.
Currently, the callback is called with 3 parameters:
callback(result, status, xhr)
. This is supplied by theparseReq
function.However, this is only done for the
success
,error
&always
methods (and by extension, the callback passed to the initial call). The actual promise returned still resolves to just the rawxhr
object.I think it would make more sense to pipe the promise directly into
parseReq
:Then the aliases become just that: aliases.
The only issue here is that sadly most current promise implementations do not support multi-value fulfillment. We can either pass an array to
then
, or just pass the parsedresult
.The text was updated successfully, but these errors were encountered: