var lesson = {
	files: [
		{
			name: "main",
			content: "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n  const [a, setA] = createSignal(1);\n  const [b, setB] = createSignal(1);\n\n  createEffect(() => {\n    console.log(a(), b());\n  });\n\n  return <>\n    <button onClick={() => setA(a() + 1)}>Increment A</button>\n    <button onClick={() => setB(b() + 1)}>Increment B</button>\n  </>\n};\n\nrender(App, document.getElementById(\"app\"));\n"
		}
	]
};
var solved = {
	files: [
		{
			name: "main",
			content: "import { render } from \"solid-js/web\";\nimport { createSignal, createEffect, on } from \"solid-js\";\n\nconst App = () => {\n  const [a, setA] = createSignal(1);\n  const [b, setB] = createSignal(1);\n\n  createEffect(on(a, (a) => {\n    console.log(a, b());\n  }, { defer: true }));\n\n  return <>\n    <button onClick={() => setA(a() + 1)}>Increment A</button>\n    <button onClick={() => setB(b() + 1)}>Increment B</button>\n  </>\n};\n\nrender(App, document.getElementById(\"app\"));\n"
		}
	]
};
var markdown = "为方便起见，Solid 提供一个 `on` 工具函数，可以为我们的计算设置显式依赖。这主要用来更明确地简洁地声明跟踪哪些信号。然而，它也允许计算不立即执行而只在第一次更改时运行。可以使用`defer` 选项启用此功能。\n\n让 Effect 只在 `a` 更新时运行，并推迟到值发生变化时执行。\n\n```js\ncreateEffect(on(a, (a) => {\n  console.log(a, b());\n}, { defer: true }));\n```\n";
var reactivity_on = {
	lesson: lesson,
	solved: solved,
	markdown: markdown
};

export { reactivity_on as default, lesson, markdown, solved };
