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

docs: queueing a series of updates #1095

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

dgodinez-dh
Copy link
Contributor

plugins/ui/docs/hooks/use_state.md Outdated Show resolved Hide resolved
set_friend_count(lambda fc: fc * 2)
```

If you prefer more verbose code, another common convention is to repeat the full state variable name, like `set_enabled(lambda enabled: not enabled)`, or to use a prefix like `set_enabled(lambda prev_enabled: not prev_enabled)`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should mention multi-threaded cases somewhere. Have a note that in multi-threaded cases they aren't batched by default and you need to use the use_render_queue to ensure they do get batched if you're going to do work from a background thread.
Got a note about it in the use_render_queue docs: https://salmon.deephaven.io/core/ui/docs/hooks/use_render_queue/#batch-updates
This is different than React because JS is single threaded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note and linked to the use_render_queue docs.

@dgodinez-dh dgodinez-dh requested a review from mofojed January 27, 2025 19:40
mofojed
mofojed previously approved these changes Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants