All Projects → leer0911 → Myxhr

leer0911 / Myxhr

TypeScript 重构 Axios 经验分享,包括开发技巧, API 实现,XMLHttpRequest 运用,单元测试等

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Myxhr

vue-webpack-boilerplate
A webpack boilerplate with vue-loader, axios, vue-router and vuex
Stars: ✭ 51 (-50%)
Mutual labels:  karma, axios
Gitdatav
基于Vue框架构建的github数据可视化平台
Stars: ✭ 1,328 (+1201.96%)
Mutual labels:  axios
Cookiecutter Webpack
Boilerplate for webpack 2, babel, react + redux + hmr, and karma. Can be inserted into existing django projects.
Stars: ✭ 87 (-14.71%)
Mutual labels:  karma
Spala
Spala (SPA LARAVEL): a modern lightweight CMS for Laravel and Vue developers (open source project).
Stars: ✭ 91 (-10.78%)
Mutual labels:  axios
Placeline Nextjs
HyperTrack Placeline web application sample using NextJS, Ant-Design, Styled-Components, and Heroku
Stars: ✭ 88 (-13.73%)
Mutual labels:  axios
Taro Axios
在 Taro 中使用 axios。
Stars: ✭ 92 (-9.8%)
Mutual labels:  axios
Retrofit Cjs
retrofit-cjs 是一个基于JavaScript装饰器(Decorator)和 axios 实现的网络请求库, 支持Vue / React / react-native 等常用框架
Stars: ✭ 87 (-14.71%)
Mutual labels:  axios
Vuedemo sell eleme
ele by vue2.x 🐧
Stars: ✭ 1,349 (+1222.55%)
Mutual labels:  axios
Vue Typescript Music
🔥 基于 vue 全家桶 音乐项目(Music project) vue+typescript 实现 高仿 网易云音乐 移动端WebApp
Stars: ✭ 94 (-7.84%)
Mutual labels:  axios
Egg Vue Webpack Boilerplate
Egg Vue Server Side Render (SSR) / Client Side Render (CSR)
Stars: ✭ 1,302 (+1176.47%)
Mutual labels:  axios
Vue2 Qq
一个基于兴趣,为了学习,提高能力的项目
Stars: ✭ 90 (-11.76%)
Mutual labels:  axios
Karma Benchmark
A Karma plugin to run Benchmark.js over multiple browsers with CI compatible output.
Stars: ✭ 88 (-13.73%)
Mutual labels:  karma
Xyy Vue
🎨基于vue+vue-router+vuex+axios+webpack开发的个人Demo《Qu约》
Stars: ✭ 1,316 (+1190.2%)
Mutual labels:  axios
Github User Search
Browse GitHub users with React
Stars: ✭ 87 (-14.71%)
Mutual labels:  axios
Eagles
eagles for vue componets of silianpan
Stars: ✭ 95 (-6.86%)
Mutual labels:  axios
Poetryclub Backend
基于 laravel + vue.js 的诗词小筑网站后台页面与后端代码
Stars: ✭ 87 (-14.71%)
Mutual labels:  axios
Vue Lottery
🎨 抽奖以及截屏保存图片至本地
Stars: ✭ 90 (-11.76%)
Mutual labels:  axios
Reactjs Spring Boot Crud Full Stack App
Learn how to develop a full-stack CRUD application using React as frontend and spring boot as backend.
Stars: ✭ 90 (-11.76%)
Mutual labels:  axios
Django Auth0 Vue
A Django REST Framework + Vue.js CRUD Demo Secured Using Auth0
Stars: ✭ 99 (-2.94%)
Mutual labels:  axios
Fontend
使用Node、Vue、ElementUI、iViewUI,验证码等等搭建一个综合性网站(含后台管理系统)
Stars: ✭ 97 (-4.9%)
Mutual labels:  axios

myXHR

又是一篇关于 TypeScript 的分享,上次用 TypeScript 重构 Vconsole 的项目 埋下了对 Axios 源码解析的梗。于是,这次分享的主题就是 如何从零用 TypeScript 重构 Axios 以及为什么我要这么做

教程

TypeScript 重构 Axios 全攻略

特性

  • √ 从浏览器创建 XMLHttpRequest
  • √ 支持 Promise API
  • √ 拦截请求和响应
  • √ 转换请求和响应数据
  • √ 取消请求
  • √ 自动转换 JSON 数据
  • √ 客户端支持防止 XSRF

开始

# 安装依赖
yarn

# 开发及调试
yarn dev

# 构建
yarn build

# 测试
yarn test

欢迎各位重构,相互交流!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].