Skip to content

Commit

Permalink
Clean up from review
Browse files Browse the repository at this point in the history
- Specify list or dict for the row_data vs row_list methods
- Add link to toast
- Add warning in the use_table_listener hook intro paragraph
  • Loading branch information
mofojed committed Dec 12, 2024
1 parent 59a5734 commit e192458
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/ui/docs/hooks/use_render_queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def toast_table(t):
my_toast_table = toast_table(_source)
```

The above example listens to table updates and displays a toast message when the table updates. The `toast` function must be triggered on the render thread, whereas the listener is not fired on the render thread. Therefore, you must use the render queue to trigger the toast.
The above example listens to table updates and displays a toast message when the table updates. The [`toast` function](../components/toast.md) must be triggered on the render thread, whereas the listener is not fired on the render thread. Therefore, you must use the render queue to trigger the toast.

## UI recommendations

Expand Down Expand Up @@ -101,7 +101,7 @@ def ui_batch_example():
batch_example = ui_batch_example()
```

When running the above example, _two_ toasts appear with each button press: a red one where `a != b` (as `a` gets updated first), then a neutral one where `a == b` (as `b` gets updated second). Use the `use_render_queue` hook to ensure the updates are always batched together when working with a background thread:
When running the above example, _two_ toasts appear with each button press: a red one where `a != b` (as `a` gets updated first), then a neutral one where `a == b` (as `b` gets updated second). Use the `use_render_queue` hook to ensure the updates are always batched together when working with a background thread:

```python
from deephaven import ui
Expand Down
2 changes: 1 addition & 1 deletion plugins/ui/docs/hooks/use_row_data.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# use_row_data

`use_row_data` lets you use the data of the first row of a table. This is useful when you want to listen to an updating table and use the data in your component.
`use_row_data` lets you use the data of the first row of a table as a dictionary. This is useful when you want to listen to an updating table and use the data in your component.

## Example

Expand Down
2 changes: 1 addition & 1 deletion plugins/ui/docs/hooks/use_table_listener.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# use_table_listener

`use_table_listener` lets you listen to a table for updates. This is useful when you want to listen to a table and perform an action when the table updates.
`use_table_listener` lets you listen to a table for raw updates. This is an advanced feature requiring an understanding of how [table listeners](https://deephaven.io/core/docs/how-to-guides/table-listeners-python/) work and limitations of running code while the Update Graph is running. Most usages of this are more appropriate to implement with [the table data hooks](./overview.md#data-hooks). This is useful when you want to listen to the raw updates from a table and perform a custom action when the table updates.

## Example

Expand Down

0 comments on commit e192458

Please sign in to comment.