Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/holtwood/awesome-cursorrules-zhWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/mobx-reaction-usage)<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/mobx-reaction-usage"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/mobx-reaction-usage/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/mobx-reaction-usage"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/mobx-reaction-usage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00648 |
| Opus 5 | $0.00000 | $0.00324 |
| Sonnet 5 | $0.00000 | $0.00130 |
| Haiku 4.5 | $0.00000 | $0.00065 |
Grade A, and why
mobx-reaction-usage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
- 使用
reaction处理基于可观察变化的副作用:reaction的作用:reaction是 MobX 提供的一种副作用处理机制,它接受两个函数作为参数:第一个函数(data函数)跟踪其内部使用的可观察数据,并返回一个值;第二个函数(effect函数)接收data函数的返回值,并在data函数返回的值发生变化时执行。- 与
autorun不同,reaction允许你更精确地控制哪些数据变化会触发副作用,并且effect函数不会在初始化时立即运行。
- 使用场景:
- 当你需要根据 MobX 状态的变化执行一些副作用,例如:
- 异步数据加载(例如,当用户 ID 变化时加载用户数据)。
- 订阅外部服务或事件。
- 写入本地存储(localStorage)。
- 打印日志。
- 当你需要根据 MobX 状态的变化执行一些副作用,例如:
- 示例:
import { makeObservable, observable, action, reaction } from 'mobx'; class UserStore { @observable userId = 0; @observable userData = null; constructor() { makeObservable(this); reaction( () => this.userId, // data 函数:跟踪 userId async (userId) => { if (userId > 0) { console.log(`Fetching user data for userId: ${userId}`); // 模拟异步请求 this.userData = await new Promise(resolve => setTimeout(() => resolve({ id: userId, name: `User ${userId}` }), 500) ); } else { this.userData = null; } }, { fireImmediately: true } // 立即执行一次 effect 函数 ); } @action setUserId(id: number) { this.userId = id; } } const userStore = new UserStore(); userStore.setUserId(1); // 这将触发 reaction,加载用户数据 // userStore.setUserId(2); // 再次触发 reaction - 最佳实践:
- 尽量在 store 内部使用
reaction来处理与状态相关的副作用,保持组件的纯粹性。 - 避免在
data函数中执行耗时操作,因为它会频繁运行。 - 如果副作用需要清理(例如,取消订阅),
reaction函数会返回一个清理函数,可以在组件卸载时调用它。 - 对于简单的、不依赖于特定数据变化的副作用,可以考虑使用
autorun。
- 尽量在 store 内部使用
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 57 lines · 0 tokens per session scan A c5fb0c1b5107
mobx-reaction-usage is a cursor rule published in the GitHub repository holtwood/awesome-cursorrules-zh (233 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 648 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other cursor rules, from other repositories
component-development
Modern React + TypeScript component patterns — hooks, typed props, performance optimization, forms, and testing.
app-router-patterns
Next.js 14+ App Router patterns — Server Components, Client Components, Route Handlers, Server Actions, and metadata API.
semiotic-react-dataviz-cursorrules-prompt-file
Cursor rules for Semiotic data visualization library with 30+ chart types, MCP server, and AI-assisted chart generation.
next-type-llm
Cursor rules for Next.js development with Type LLM integration.
ai-agent-specialist
Cursor rules for TypeScript, React, Node.js, clean architecture, testing, and WHY-oriented engineering guidance.
nextjs
Next.js with TypeScript and Tailwind UI best practices.