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

How to combine multiple collection queries into a single hook? #82

Open
NorthMcCormick opened this issue Aug 23, 2023 · 0 comments
Open

Comments

@NorthMcCormick
Copy link

HI All,

This might be more of a react question and not as related to the hooks, I'm just struggling to understand how I can combine multiple collection queries into a single hook result that gets updated if the data in one query changes in the database?

I want to re-use the logic provided in these hooks because it is so robust, and gather data from two queries to construct data for my UI in a single hook that can be placed in my components.

I've been poking my way through trying to create a custom hook that implements multiple of these but I'm not having much luck.

Would anyone happen to have any sample code or insight into how I can achieve this using these hooks without having to reimplement all the 'isFetching' and observables?

Is useMemo what I should be looking at?

Any insight is greatly appreciated

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

1 participant