var lesson = {
	files: [
		{
			name: "main",
			content: "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n  const [count, setCount] = createSignal(0);\n\n  setInterval(() => setCount(count() + 1), 1000);\n\n  return <div>Count: {count()}</div>;\n}\n\nrender(() => <Counter />, document.getElementById('app'));"
		}
	]
};
var solved = {
	files: [
		{
			name: "main",
			content: "import { render } from \"solid-js/web\";\nimport { createSignal, onCleanup } from \"solid-js\";\n\nfunction Counter() {\n  const [count, setCount] = createSignal(0);\n\n  const timer = setInterval(() => setCount(count() + 1), 1000);\n  onCleanup(() => clearInterval(timer));\n\n  return <div>Count: {count()}</div>;\n}\n\nrender(() => <Counter />, document.getElementById('app'));"
		}
	]
};
var markdown = "Some frameworks pair their cleanup methods as return values of their side effects or lifecycle methods. Since everything in a Solid render tree is living inside a (possibly inert) Effect and can be nested, we made `onCleanup` a first-class method. You can call it at any scope and it will run when that scope is triggered to re-evaluate and when it is finally disposed.\n\nUse it in your components or in your Effects. Use it in your custom directives. Use it pretty much anywhere that is part of the synchronous execution of the reactive system.\n\nThe Signal example from the introduction never cleaned up after itself. Let's fix that by replacing the `setInterval` call with this:\n\n```js\nconst timer = setInterval(() => setCount(count() + 1), 1000);\nonCleanup(() => clearInterval(timer));\n```";
var lifecycles_oncleanup = {
	lesson: lesson,
	solved: solved,
	markdown: markdown
};

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