Skip to content

Commit

Permalink
Fixed useQuery load callback when autoLoad is false
Browse files Browse the repository at this point in the history
  • Loading branch information
klis87 committed Mar 14, 2021
1 parent f085175 commit cf22864
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/redux-requests-react/src/use-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,10 @@ const useQuery = ({
const key = `${selectorProps.type}${selectorProps.requestKey || ''}`;

const dispatchQuery = useCallback(() => {
if (autoLoad) {
return dispatchRequest(
(selectorProps.action || selectorProps.type)(...variables),
);
}

return Promise.resolve(null);
}, [autoLoad, selectorProps.action, selectorProps.type, ...variables]);
return dispatchRequest(
(selectorProps.action || selectorProps.type)(...variables),
);
}, [selectorProps.action, selectorProps.type, ...variables]);

const dispatchStopPolling = useCallback(() => {
dispatchRequest(
Expand Down

0 comments on commit cf22864

Please sign in to comment.