fix code error

This commit is contained in:
qingwei.li
2016-11-28 12:33:25 +08:00
parent 7c05d729b4
commit 93ddf08615
2 changed files with 12 additions and 2 deletions

View File

@@ -5,7 +5,13 @@ export default function (url, options = {}) {
xhr.send()
return {
then: cb => xhr.addEventListener('load', cb),
catch: cb => xhr.addEventListener('error', cb)
then: function (cb) {
xhr.addEventListener('load', cb)
return this
},
catch: function (cb) {
xhr.addEventListener('error', cb)
return this
}
}
}