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

fix: useViewportData - memoize subscriptions and first row of viewport #2008

Merged

Conversation

bmingles
Copy link
Contributor

@bmingles bmingles commented May 13, 2024

fixes #2003 - useViewportData - re-subscribes to table any time ViewportData changes

  • Memoized dh.Table.EVENT_SIZECHANGED handler
  • Memoized dh.Table.EVENT_UPDATED handler

fixes #1928 - useViewportData - setViewport should maintain last firstRow value when table size changes

  • Track last set "first row" to be re-used when table size changes but table reference remains the same

Tested

  • Ticking table
    • table update subscriptions no longer occur on each viewportData change
    • size change handler no longer re-subscribes on every render
  • ACL Editor - scrolling viewport data still works. Filtering still properly resets viewport to zero

@bmingles bmingles requested a review from mofojed May 13, 2024 21:43
@bmingles bmingles marked this pull request as ready for review May 13, 2024 21:43
@bmingles bmingles merged commit 2246a4a into deephaven:main May 14, 2024
9 checks passed
@bmingles bmingles deleted the 1928-useViewportData-maintain-viewport branch May 14, 2024 19:40
@github-actions github-actions bot locked and limited conversation to collaborators May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants