Zustand 状态管理
原名:zustand-store-ts
用 TypeScript 和 subscribeWithSelector 构建职责清晰的 Zustand Store。
中文 Skills 技能说明
适合 React 应用的跨组件状态、编辑器状态和选择性订阅。技能会分开状态与动作并控制订阅范围,避免所有数据塞进全局 Store;敏感令牌不能持久化到不安全存储,状态改造后应检查渲染与并发更新。
上游能力依据
上游原始适用说明:Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.
上游 SKILL.md 主要章节(保留原文标题):
- Quick Start
- Always Use subscribeWithSelector
- Separate State and Actions
- Use Individual Selectors
- Subscribe Outside React
- Integration Steps
使用边界
先读取项目约定、依赖版本和现有测试,再提出最小改动。写文件、运行脚本、提交代码或发布前应检查差异并保留回退路径。
作者、翻译与许可证
- 原作者
- Microsoft Corporation 与 microsoft/skills contributors
- 中文翻译
- CEOFans翻译
- 许可证
- MIT
- 上游来源
- https://github.com/microsoft/skills/tree/7066b58141d8cc66f39356b2ee5bb64d428dcf17/.github/plugins/azure-sdk-typescript/skills/zustand-store-ts
适用范围
平台:linux、macos、windows;标签:软件开发、Zustand 状态管理
安全提示
基础静态扫描不等于绝对安全。技能可能调用命令、浏览器、云服务或本地文件,请在最小权限环境中使用,高风险操作必须人工确认。
如发现侵权、许可证或安全问题,可在本页前台提交投诉,管理员复核后可立即下架。