fix code error

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

View file

@ -1,3 +1,7 @@
## 0.4.2
## Bug fixes
- Correct catch ajax error
## 0.4.1 ## 0.4.1
## Bug fixes ## Bug fixes
- catch ajax error - catch ajax error

View file

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