XHR的简单封装xr.zip

时间:2022-08-08 01:15:07
【文件属性】:
文件名称:XHR的简单封装xr.zip
文件大小:28KB
文件格式:ZIP
更新时间:2022-08-08 01:15:07
开源项目 xr 是 XMLHttpRequest 的超简单封装,并返回 ES6 Promise。示例代码:xr.get('/api/items', {take: 5})   .then(res => console.log(res.data)); xr.post('/api/item', {name: 'hello'})   .then(res => console.log("new item", res.data)); xr({   method: xr.Methods.GET,   url: '/api/items',   params: {take: 5},   events: {     progress: (xhr, xhrProgressEvent) => {       console.log("xhr", xhr);       console.log("progress", xhrProgressEvent);     }   } });
【文件预览】:
xr-master
----.eslintrc(1KB)
----xr.js(4KB)
----package.json(967B)
----tslint.json(2KB)
----tsfmt.json(682B)
----LICENSE(1KB)
----constants.d.ts(647B)
----src()
--------xr.ts(4KB)
--------constants.ts(757B)
----.npmignore(5B)
----tsconfig.json(562B)
----index.d.ts(1KB)
----AUTHORS(323B)
----.gitignore(39B)
----webpack.config.js(759B)
----CHANGELOG.md(2KB)
----README.md(3KB)
----yarn.lock(49KB)
----scripts()
--------rename.js(107B)
----.editorconfig(49B)

网友评论