
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
react-request-queue
Advanced tools
A React hook to manage request queues, ensuring that only one request is processed at a time to avoid inconsistent results due to asynchronous issues.
You can install this package using npm:
npm install react-request-queue
Or using yarn:
yarn add react-request-queue
First, import the useRequestQueue hook in your component:
import React, { useEffect } from 'react';
import useRequestQueue from 'react-request-queue';
Define the function that will handle the requests. This function should be asynchronous:
const fetchDataLocal = async (params: any) => {
const response = await api.fetchDataRemote(params);
};
Use the useRequestQueue hook in your component, passing the request function and dependencies:
const MyComponent = ({ dep1, dep2 }) => {
const { addToQueue } = useRequestQueue(fetchDataLocal, [dep1, dep2]);
useEffect(() => {
const params = {dep1, dep2};
addToQueue(params);
}, [dep1, dep2]);
return (
<div>
{/* Your component content */}
</div>
);
};
export default MyComponent;
useRequestQueue(requestFunction, dependencies)requestFunction (Function): The function that will handle the requests. It should return a promise.dependencies (Array): An array of dependencies that will trigger the processing of the queue when they change.addToQueue (Function): A function to add a new request to the queue.MIT
FAQs
[中文简体](./README-zh.md)
We found that react-request-queue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.