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 push behavior to useQueryPersistedState #28302

Merged
merged 5 commits into from
Mar 7, 2025

Conversation

salazarm
Copy link
Contributor

@salazarm salazarm commented Mar 6, 2025

Summary & Motivation

Add push behavior so that we can use this for selection syntax to allow back to go to the previous syntax.

How I Tested These Changes

jest + local testing

@salazarm salazarm requested review from bengotow and hellendag March 6, 2025 20:47
Copy link

github-actions bot commented Mar 6, 2025

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-qiv7ybc57-elementl.vercel.app
https://salazarm-add-behavior-to-use-query-persisted-state.core-storybook.dagster-docs.io

Built with commit 69f5375.
This pull request is being automatically deployed with vercel-action

Comment on lines 122 to 124
history.push(
`${history.location.pathname}?${qs.stringify(next, {arrayFormat: 'brackets'})}`,
);
Copy link
Member

Choose a reason for hiding this comment

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

Build the string once prior to the conditionals so that if something in the callsite has to change, we don't accidentally overlook one?

Copy link
Collaborator

@bengotow bengotow left a comment

Choose a reason for hiding this comment

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

Looks great, sorta wild we got this far without this behavior - maybe separately we can go through existing uses and see if there are others where push would be preferable. I feel like there probably are!

@salazarm salazarm merged commit 6d3192a into master Mar 7, 2025
6 of 7 checks passed
@salazarm salazarm deleted the salazarm/add-behavior-to-use-query-persisted-state branch March 7, 2025 18:12
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.

3 participants