Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Add useRequests hooks #158

Closed
mili-confluent opened this issue Dec 11, 2019 · 5 comments
Closed

Feature Request - Add useRequests hooks #158

mili-confluent opened this issue Dec 11, 2019 · 5 comments

Comments

@mili-confluent
Copy link
Contributor

redux-query-react has the hook: useRequest but it did not support requests for multiple requests, so I am planning to create a hook useRequests which can send a lot of requests at the same time.

@rctbusk
Copy link
Contributor

rctbusk commented Dec 11, 2019

Hey @mili-confluent, this is actually the next step on the roadmap for redux-query-react. Hopefully will have a PR open in the next week or so along with an alpha release. Would love to get your feedback when I open the PR.

@mili-confluent
Copy link
Contributor Author

Thank you @rctbusk

@kamranayub
Copy link
Contributor

kamranayub commented Jan 7, 2020

@rctbusk Saw this was in the docs and available, I think, but TS is not finding the exported function (wondering if somehow types are out-of-date?)

image

edit: Indeed it looks like it may be missing here https://github.com/amplitude/redux-query/blob/master/packages/redux-query-react/index.d.ts#L49

I could see if I could whip up a quick PR, hmm.

@mili-confluent
Copy link
Contributor Author

I find there is a lot of cancel query warning when I use conncetRequest. It seems we did not return the function correctly so that the finished callback did not really delete the pending key.

const finishedCallback = useConstCallback(() => {
(queryKey: QueryKey) => {
pendingRequests.current.delete(queryKey);
};
});

@rctbusk
Copy link
Contributor

rctbusk commented Jan 11, 2020

These PRs are included in the newest version release. 3.3.1. Let me know if this issues are fixed. Closing this issue unless hearing otherwise.

@rctbusk rctbusk closed this as completed Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants