![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
ts-x-request-pool
Advanced tools
> >Http的前端请求池,避免重复的请求。 > >使用单例模式,相同的请求会只发送一次,其余的则等待同请求返回后,再返回。 > > [Demo](https://mikexia930.github.io/xRequestPool/) ## 版本 - v1.1.0
Http的前端请求池,避免重复的请求。
使用单例模式,相同的请求会只发送一次,其余的则等待同请求返回后,再返回。
npm install ts-x-request-pool
或者
github下载源码
直接用script引入
<script src="lib/xrequestpool.umd.js"></script>
在main.js引入
import XRequestPool from 'x-request-pool';
获取实例
const insConfig = {
baseUrl: '', // 会和 requestConfig 的 url 合并
timeout: 300, // 连接超时时间 秒
headers: object, // 头文件,具体设置可参考axios
};
const RequestPoolIns = RequestPool.getRequestIns(insConfig);
发送请求
const requestConfig = {
url: string, // 链接地址
method: string, //请求方法 GET\POST\DELETE
headers: object, // 头文件,具体设置可参考axios
params: object, // get请求时的参数
data: 'object', // post请求时的参数
};
RequestPool.doRequest(RequestPoolIns, requestConfig).then((result) => {
this.resultData = `${this.resultData}\n${JSON.stringify(result)}`;
console.log('result-', result);
}).catch((err) => {
console.log('err-', err);
});
获取当前连接池里的连接数据
RequestPool.getRequestPools(); // { key: { 具体数据 } }
取消请求
RequestPool.cancelRequest(key?); // 不填写key,则取消所有
FAQs
> >Http的前端请求池,避免重复的请求。 > >使用单例模式,相同的请求会只发送一次,其余的则等待同请求返回后,再返回。 > > [Demo](https://mikexia930.github.io/xRequestPool/) ## 版本 - v1.1.0
We found that ts-x-request-pool demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.