一键导入
kea-atomic-selectors
TypeScript Kea framework - adding atomic signal selectors and logic.selectorHealth
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
TypeScript Kea framework - adding atomic signal selectors and logic.selectorHealth
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | kea-atomic-selectors |
| description | TypeScript Kea framework - adding atomic signal selectors and logic.selectorHealth |
| args | [] |
When a task asks you to add atomic/signal selectors to Kea, the implementation is not complete until you modify the existing Kea source files to wire the feature in. Do not leave the code in standalone files.
src/kea/build.ts
BuiltLogic object is constructed in getBuiltLogic() around lines 88-119.mount, unmount, isMounted) are attached, attach selectorHealth.selectorHealth must be a method on the logic instance that returns health metadata for every selector in this logic.src/core/selectors.ts
src/kea/build.ts.src/kea/context.ts
atomicSelectors option from resetContext({ atomicSelectors: true }).src/kea/build.ts and src/core/selectors.ts can decide whether to enable atomic tracking.src/index.ts
AtomicSelectorHealth, AtomicSelectorEngine).logic.selectorHealth() exists on mounted BuiltLogic instances.logic.selectorHealth() returns { selectors: Record<name, { dependencies, dependents, evaluations, dirtyCause }>, topologicalOrder: string[] }.user.name, not just user.resetContext({ atomicSelectors: true }) was used.rollup.config.js, tsconfig.json, or build tooling unless the task explicitly requires it. If npm test fails inside the test:tsd or build step, run the focused jest test file instead: npx jest test/jest/atomic.js (or the relevant test file). Only run the full npm test after the focused atomic tests pass.const { kea } = require('./src/index.ts') // or built output
const logic = kea({ selectors: { userName: [(s) => s.user, (u) => u.name]] } })
logic.mount()
console.log(typeof logic.selectorHealth) // must be 'function'
If logic.selectorHealth is undefined, you have not wired it into src/kea/build.ts. Fix that before finishing.
Frontend design and UI component implementation patterns.
Go agent patterns for exploring, editing, and validating Go codebases.
TypeScript library framework-wiring patterns for adding features to existing codebases.