-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix conditional use_effect in use_table_listener (#422)
fixes #384 Moves the refreshing table check to ensure the `use_effect` is always called. Also added a `use_effect` to `use_table_data` to ensure that when a table is swapped it updates the resulting data Here is an example of flipping between ticking and static tables ``` import deephaven.ui as ui from deephaven.table import Table from deephaven import time_table, empty_table empty_t = empty_table(0) time_t = time_table("PT1S").tail(1) @ui.component def test_component(): empty, set_empty = ui.use_state(True) val = ui.use_table_data(empty_t if empty else time_t) button = ui.action_button(str(empty), on_press=lambda: set_empty(not empty)) return [button, str(val)] data = test_component() ```
- Loading branch information
1 parent
6ead733
commit 5f4f238
Showing
3 changed files
with
53 additions
and
5 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
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