Skip to content

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

Open
@NorthMcCormick

Description

@NorthMcCormick

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions