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

Add useGetAggregateFromServerQuery hook #106

Merged

Conversation

HassanBahati
Copy link
Collaborator

This PR adds useGetAggregateFromServerQuery hook

Copy link

docs-page bot commented Sep 26, 2024

To view this pull requests documentation preview, visit the following URL:

react-query-firebase.invertase.dev/~106

Documentation is deployed and generated using docs.page.

: never;
};

export function useGetAggregateFromServerQuery<T extends AggregateSpec>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change the API spec here, since the aggregates are a requirement, so:

useGetAggregateFromServerQuery(query, {
    countOfDocs: count(),
    totalHours: sum('hours'),
    averageScore: average('score')
});

Let's keep any optional parts in the firestore key and make sure they are all optional values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the clarity here. absolutely, going to adjust here and keep all required parts at the top level and optional parts maintaining them as optional in the firestore key object

@Ehesp Ehesp merged commit 3786583 into invertase:next Sep 30, 2024
1 of 2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants