Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Allow useCollection to only run when certain conditons are met #1150

Closed
mikejolley opened this issue Nov 11, 2019 · 1 comment · Fixed by #1182
Closed

Allow useCollection to only run when certain conditons are met #1150

mikejolley opened this issue Nov 11, 2019 · 1 comment · Fixed by #1182
Assignees
Labels
type: enhancement The issue is a request for an enhancement.

Comments

@mikejolley
Copy link
Member

When working on Attribute Filters there were some cases where we needed to wait for certain data to become available (from the REST API) before passing that data to another REST API request. Queries are performed using useCollection hooks. Hooks cannot be executed or ran conditionally.

To get around this, @nerrad suggested added a callback (or boolean?) to the useCollection hook which would return true/false to as whether or not to run the query yet. In this case, we'd check if the dependency value existed before running the query.

@mikejolley mikejolley added the type: enhancement The issue is a request for an enhancement. label Nov 11, 2019
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label type: feature request to this issue, with a confidence of 0.90. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants