first commit

This commit is contained in:
qingwei.li 2016-11-20 15:56:37 +08:00
commit 44ac51b9c2
20 changed files with 331 additions and 0 deletions

10
src/ajax.js Normal file
View file

@ -0,0 +1,10 @@
export default function (url, options = {}) {
const xhr = new XMLHttpRequest()
xhr.open(options.method || 'get', url)
xhr.send()
return {
then: cb => xhr.addEventListener('load', cb)
}
}