var lesson = {
	files: [
		{
			name: "main",
			content: "import { createSignal, createResource } from \"solid-js\";\nimport { render } from \"solid-js/web\";\n\nconst fetchUser = async (id) =>\n  (await fetch(`https://swapi.dev/api/people/${id}/`)).json();\n\nconst App = () => {\n  const [userId, setUserId] = createSignal();\n  const [user] = createSignal();\n\n  return (\n    <>\n      <input\n        type=\"number\"\n        min=\"1\"\n        placeholder=\"Enter Numeric Id\"\n        onInput={(e) => setUserId(e.currentTarget.value)}\n      />\n      <span>{user.loading && \"Loading...\"}</span>\n      <div>\n        <pre>{JSON.stringify(user(), null, 2)}</pre>\n      </div>\n    </>\n  );\n};\n\nrender(App, document.getElementById(\"app\"));\n"
		}
	]
};
var solved = {
	files: [
		{
			name: "main",
			content: "import { createSignal, createResource } from \"solid-js\";\nimport { render } from \"solid-js/web\";\n\nconst fetchUser = async (id) =>\n  (await fetch(`https://swapi.dev/api/people/${id}/`)).json();\n\nconst App = () => {\n  const [userId, setUserId] = createSignal();\n  const [user] = createResource(userId, fetchUser);\n\n  return (\n    <>\n      <input\n        type=\"number\"\n        min=\"1\"\n        placeholder=\"Enter Numeric Id\"\n        onInput={(e) => setUserId(e.currentTarget.value)}\n      />\n      <span>{user.loading && \"Loading...\"}</span>\n      <div>\n        <pre>{JSON.stringify(user(), null, 2)}</pre>\n      </div>\n    </>\n  );\n};\n\nrender(App, document.getElementById(\"app\"));\n"
		}
	]
};
var markdown = "Resources are special Signals designed specifically to handle Async loading. Their purpose is wrap async values in a way that makes them easy to interact with in Solid's distributed execution model. This is the opposite to `async`/`await` or generators which provide sequential execution models. The goal is for async to not block execution and not color our code.\n\nResources can be driven by a source signal that provides the query to an async data fetcher function that returns a promise. The contents of the fetcher function can be anything. You can hit typical REST endpoints or GraphQL or anything that generates a promise. Resources are not opinionated on the means of loading the data, only that they are driven by promises.\n\nThe resulting Resource Signal also contains reactive `loading` and `error` properties that make it easy to control our view based on the current status.\n\nSo let's replace our user signal with a resource:\n```js\nconst [user] = createResource(userId, fetchUser);\n```\nIt is driven by the `userId` Signal and calls our fetch method on change. Not much else to it.\n\nThe second value that comes back from `createResource` contains a `mutate` method for directly updating the internal Signal and a `refetch` method to reload the current query even if the source hasn't changed.\n\n```js\nconst [user, { mutate, refetch }] = createResource(userId, fetchUser);\n```\n\n`lazy` uses `createResource` internally to manage its dynamic imports.\n";
var async_resources = {
	lesson: lesson,
	solved: solved,
	markdown: markdown
};

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