Comments (2)
这里的拉取是指轮询吗?
在中后台场景下,websocket 的使用并不普及,轮询还是一个比较常用的处理方法。比如查询一个项目的构建状态,预案执行的情况等等。所以直接在 useAsync 里内置了定时器,希望能最大程度上降低业务代码逻辑的复杂度。
from hooks.
这里的拉取是指轮询吗?
在中后台场景下,websocket 的使用并不普及,轮询还是一个比较常用的处理方法。比如查询一个项目的构建状态,预案执行的情况等等。所以直接在 useAsync 里内置了定时器,希望能最大程度上降低业务代码逻辑的复杂度。
我个人认为轮训的在所有 async 请求的比例不算太高,轮训应该是一个新的 hooks。
不过现在已经写了,也不能改了。
from hooks.
Related Issues (20)
- useRequest 开启 staleTime 缓存后轮询失效 HOT 1
- useRequest 在react18 开启严格模式下 data 无法正常返回数据 一直是undefined HOT 9
- useInfiniteScroll reload 重置问题 HOT 3
- useRequest 的 setCache 和 getCache 似乎不支持异步 HOT 1
- useRequest循环调用多次run, onSuccess只执行一次 HOT 6
- useRequest 在 React 18 部分场景下不兼容, 存在严重问题 HOT 2
- Can I customize the handshake headers when using useWebSocket? HOT 3
- useLocalSorageState无法监听全局localStorage修改的事件 HOT 1
- useKeyPress: ["alt.c"] seems do not work HOT 3
- useKeyPress second argument always undefined
- useRequest 会考虑把 http status code 纳入处理过程么? HOT 1
- BUG useClickAway 不可用 HOT 6
- useWebSocket 没有提供重置latestMessage的方法 HOT 2
- useAntdTable 初始化请求执行2次 HOT 2
- useRequest在严格模式StrictMode下,缓存失效 HOT 9
- useInViewport 弄一個triggerOnce的參數比較好 HOT 3
- [RFC] useEventBus HOT 7
- 能不能把useTimeout升级一下? HOT 5
- 官网白屏 HOT 1
- [RFC]useSwipeEvent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hooks.