一键导入
huuma-ui-signals-and-state
Managing reactive state in Huuma UI islands with signals, computed values, effects, and lifecycle hooks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Managing reactive state in Huuma UI islands with signals, computed values, effects, and lifecycle hooks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Adding server-side mutations and form handling to a Huuma UI app with type-safe .remote.ts functions.
Diagnosing and fixing Huuma UI lint violations and runtime errors after they occur.
Editing root.tsx, entry points, dev/prod workflow, environment variables, and the Huuma UI build pipeline.
Building or navigating a Huuma UI app — file conventions, server/client boundary rules, dev workflow, and where to look for authoritative answers.
Adding translations and multilingual routing to a Huuma UI app with setupI18n, useI18n middleware, and the T component.
Adding client interactivity to a Huuma UI app with `.client.tsx` islands, on-* events, refs, and hydration boundaries.
| name | huuma-ui-signals-and-state |
| description | Managing reactive state in Huuma UI islands with signals, computed values, effects, and lifecycle hooks. |
Use this skill when the agent is managing reactive state, computed values, side effects, or component lifecycle inside a Huuma UI island.
$signal(initialValue) from @huuma/ui/hooks/signal..get()..set(newValue)..set() short-circuits when the new value is === to the current value (behavior of @huuma/ui/signal).huuma-ui-islands-interactivity).untracked(() => s.get()) from @huuma/ui/signal. Use it inside effects/computed when you need the current value of a signal without creating a dependency (e.g. logging, conditional bookkeeping, reading a ref-like value that shouldn't trigger re-runs).$computed(() => ...)..get() and updates automatically when dependencies change.$effect(() => { ... }).$mount(fn) — runs when the component mounts; return a cleanup function for destroy.$destroy(fn) — runs when the component is destroyed.@huuma/ui/hooks/lifecycle (see the README "Lifecycle Hooks" section for a $mount example).| Feature | Signal | Ref |
|---|---|---|
| Read | .get() | .get (property) |
| Write | .set(value) | .set (setter) |
| Reactive updates | yes | no — direct reference |
| Equality check | === short-circuit | none |
Refs are for direct DOM/element handles; signals are for reactive state.
.get without parentheses on a signal..get() on a ref.$signal/$effect inside an async function or after await..set.$effect/$computed purely for its current value, unintentionally adding a dependency — wrap such reads in untracked(() => s.get()) (@huuma/ui/signal).