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
{{ message }}
Repository navigation
Commit c0f7faa
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .agent/skills/htag-development/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ Declare individual state variables when you only need one or are passing it as a
121
121
- Use the `.text` property to quickly replace all text content of a tag: `self.my_label.text = "New Status"`. This completely clears existing children and replaces them with a single string.
122
122
**Background Tasks & `update()`**:
123
123
-**Automatic Reactivity**: When using `State`, mutations from background tasks (started via `asyncio.create_task`) automatically trigger UI synchronization.
124
-
-**Manual Synchronization**: For non-state changes or complex manual updates, every component exposes an `.update()` method (e.g., `self.update()`) which schedules a throttled UI broadcast.
124
+
-**Manual Synchronization**: For non-state changes or complex manual updates, every component exposes an `.update()` method (e.g., `self.update()`) which schedules a throttled UI broadcast. By default, updates are throttled at 50ms (configurable). You can adjust this on the fly: use `self.update(throttle=0.1)` for 100ms throttle, or `self.update(throttle=0)` to force an immediate broadcast.
125
125
-**Pattern**: Use `on_mount` to start background tasks and `on_unmount` to cancel them. (This pattern is now robust against page refreshes in `WebApp`).
Copy file name to clipboardExpand all lines: docs/components.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ class Clock(Tag.div):
63
63
### Background Tasks & `update()`
64
64
65
65
-**Automatic Reactivity**: `State` mutations from background tasks (started via `asyncio.create_task`) now automatically trigger UI updates.
66
-
-**Manual Synchronization**: For non-state changes, use `self.update()` to schedule a throttled UI sync.
66
+
-**Manual Synchronization**: For non-state changes, use `self.update()` to schedule a throttled UI sync. By default, it is throttled at 50ms. You can adjust it on the fly (e.g. `self.update(throttle=0.1)`for a 100ms delay, or`self.update(throttle=0)` to force an immediate broadcast).
0 commit comments