make xhr.abort reject promise chain
This commit is contained in:
parent
c1f6705a59
commit
38dba03f6d
11 changed files with 69 additions and 13 deletions
|
|
@ -398,6 +398,9 @@ Mithril = m = new function app(window) {
|
|||
xhr.open(options.method, options.url, true, options.user, options.password)
|
||||
xhr.onload = typeof options.onload == "function" ? options.onload : function() {}
|
||||
xhr.onerror = typeof options.onerror == "function" ? options.onerror : function() {}
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 0) xhr.onerror({type: "error", target: xhr})
|
||||
}
|
||||
if (typeof options.config == "function") options.config(xhr, options)
|
||||
xhr.send(options.data)
|
||||
return xhr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue