-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "isEnabled" prop to
useAssetcatalogFiltering
to allow calling h…
…ook hook while disabling all of its side effects. (#23686) ## Summary & Motivation In cloud we want to conditionally call this hook, or an elastic search backed version of the hook, but we can't do that because it would break the rules of hooks. Unfortunately the place where we want to call it conditionally is inside of another hook used by multiple different components and even other hooks, so going to the parent component and making them conditionally pass 1 version of the hook or another would not be very elegant since there would be a lot of threading of hooks around from places which really shouldn't know anything about this hook or its implementation. So... instead of that what we're doing is calling both hooks, but only returning the results of the hook we're using. The problem is that this hook has global side effects (by way of CatalogViewProvider integration and useQueryPersistedState) so I'm adding an `isEnabled` prop so that we disable all of these side effects and avoid bugs. ## How I Tested These Changes Tested with https://github.com/dagster-io/internal/pull/11040/files
- Loading branch information
Showing
2 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0827970
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for dagit-core-storybook ready!
✅ Preview
https://dagit-core-storybook-o5zvwi0be-elementl.vercel.app
Built with commit 0827970.
This pull request is being automatically deployed with vercel-action