Skip to content

Commit

Permalink
fix code error
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Nov 28, 2016
1 parent 7c05d72 commit 93ddf08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.2
## Bug fixes
- Correct catch ajax error

## 0.4.1
## Bug fixes
- catch ajax error
Expand Down
10 changes: 8 additions & 2 deletions src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

0 comments on commit 93ddf08

Please sign in to comment.