-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: Reset state when new instance of widget created #486
Conversation
mofojed
commented
May 22, 2024
- We were using the same initial data regardless of how long the widget was opened
- We want to keep the same WidgetHandler and panelIds so that panels open in the same spot
- Want to start with a fresh state
- Freeze the initialData whenever the fetched widget is updated
- Fixes Recreating UI components resets their state to when the page loaded instead of a clean state #401
- Tested using the steps in the description
- We were using the same initial data regardless of how long the widget was opened - We want to keep the same WidgetHandler and panelIds so that panels open in the same spot - Want to start with a fresh state - Freeze the initialData whenever the fetched widget is updated - Fixes deephaven#401 - Tested using the steps in the description
rerender( | ||
makeWidgetHandler({ | ||
widget: widget2, | ||
fetch: fetch2, |
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.
Is the change to fetch
what you want to test here or just the change to widget
?
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.
The descriptor. I'll have another PR up shortly that will negate the need to pass in fetch
entirely.
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.
App code change looks good. Left a couple of comments / questions on the test
- Create utility functions to make tests more readable - Clean up some comments
- Refactor some of the tests with a new utility function to be more readable
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.
LGTM