varletjs / axle Goto Github PK
View Code? Open in Web Editor NEWProgressive request tool based on axios.
License: MIT License
Progressive request tool based on axios.
License: MIT License
作为强迫症患者,很难忍受一个包占据55kb的事实
建议作者使用 matcher
单纯比较字符串来说 轻量很多
希望看到一个比较轻量的版本
axle请求 外层status 200
但是内层data为 {code: 401}
responseStatusInterceptor 只会执行validStatusHandler
invalidStatusHandler配置的401选项不会执行
表现上看起来就是 无论服务器返回什么(不局限于401 501 403),axle的状态始终是200,
导致始终会进validStatusHandler的逻辑
useResponseInterceptor(responseStatusInterceptor({
200: (res) => {
return res.data; // 成功的状态码
},
...
..
使用上述拦截器将第一层data返回后
const res = axle.get(...)
res还是还是AlxeRespons类型,没有跟拦截器返回的类型进行绑定
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.