Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const dispatchRequestToRedux = useConstCallback(queryConfig => {
const promise = reduxDispatch(requestAsync(queryConfig));
// If a promise is not returned, we know that the query middleware ignored this request and
// one will not be made, so don't consider it as "pending".
if (promise) {
isPendingRef.current = true;
}
return promise;
});
const dispatchRequestToRedux = useConstCallback((queryConfig: QueryConfig) => {
const promise = reduxDispatch(requestAsync(queryConfig));
if (promise) {
const queryKey = getQueryKey(queryConfig);
if (queryKey) {
pendingRequests.current.add(queryKey);
}
}
});