You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bmingles
changed the title
useViewportData re-subscribes to table any time ViewportData changes
useViewportData - re-subscribes to table any time ViewportData changes
May 13, 2024
#2008)
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
useViewportData
subscribes to the underlying table viauseTableListener
. It currently re-registers listeners any time theonTableUpdated
callback changes which happens any timeviewportData
changes. We should be able to get around this by passing a ref callback instead of one that changes.https://github.com/deephaven/web-client-ui/blob/main/packages/jsapi-components/src/useViewportData.ts#L122
The text was updated successfully, but these errors were encountered: