first commit
This commit is contained in:
commit
44ac51b9c2
20 changed files with 331 additions and 0 deletions
10
src/ajax.js
Normal file
10
src/ajax.js
Normal 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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue