var lesson = {
	files: [
		{
			name: "main",
			content: "import { render } from \"solid-js/web\";\nimport { Suspense } from \"solid-js\";\n\nimport fetchProfileData from \"./mock-api\";\nimport ProfilePage from \"./profile\";\n\nconst App = () => {\n  const { user, posts, trivia } = fetchProfileData();\n  return (\n    <Suspense fallback={<h1>Loading...</h1>}>\n      <ProfilePage user={user()} posts={posts()} trivia={trivia()} />\n    </Suspense>\n  );\n};\n\nrender(App, document.getElementById(\"app\"));\n"
		},
		{
			name: "profile",
			content: "import { For, Suspense, SuspenseList } from \"solid-js\";\n\nconst ProfileDetails = (props) => <h1>{props.user?.name}</h1>;\n\nconst ProfileTimeline = (props) => (\n  <ul>\n    <For each={props.posts}>{(post) => <li>{post.text}</li>}</For>\n  </ul>\n);\n\nconst ProfileTrivia = (props) => (\n  <>\n    <h2>Fun Facts</h2>\n    <ul>\n      <For each={props.trivia}>{(fact) => <li>{fact.text}</li>}</For>\n    </ul>\n  </>\n);\n\nconst ProfilePage = (props) => (\n  <>\n    <ProfileDetails user={props.user} />\n    <Suspense fallback={<h2>Loading posts...</h2>}>\n      <ProfileTimeline posts={props.posts} />\n    </Suspense>\n    <Suspense fallback={<h2>Loading fun facts...</h2>}>\n      <ProfileTrivia trivia={props.trivia} />\n    </Suspense>\n  </>\n);\n\nexport default ProfilePage;"
		},
		{
			name: "mock-api",
			content: "import { createResource } from \"solid-js\";\n\nexport default function fetchProfileData() {\n  const [user] = createResource(fetchUser);\n  const [posts] = createResource(fetchPosts);\n  const [trivia] = createResource(fetchTrivia);\n  return { user, posts, trivia };\n}\n\nfunction fetchUser() {\n  console.log(\"fetch user...\");\n  return new Promise((resolve) => {\n    setTimeout(() => {\n      console.log(\"fetched user\");\n      resolve({\n        name: \"Ringo Starr\"\n      });\n    }, 500);\n  });\n}\n\nlet ringoPosts = [\n  {\n    id: 0,\n    text: \"I get by with a little help from my friends\"\n  },\n  {\n    id: 1,\n    text: \"I'd like to be under the sea in an octupus's garden\"\n  },\n  {\n    id: 2,\n    text: \"You got that sand all over your feet\"\n  }\n];\n\nfunction fetchPosts() {\n  let ringoPostsAtTheTime = ringoPosts;\n  console.log(\"fetch posts...\");\n  return new Promise((resolve) => {\n    setTimeout(() => {\n      console.log(\"fetched posts\");\n      resolve(ringoPostsAtTheTime);\n    }, 3000 * Math.random());\n  });\n}\n\nfunction fetchTrivia() {\n  console.log(\"fetch trivia...\");\n  return new Promise((resolve) => {\n    setTimeout(() => {\n      console.log(\"fetched trivia\");\n      resolve([\n        {\n          id: 1,\n          text:\n            'The nickname \"Ringo\" came from his habit of wearing numerous rings.'\n        },\n        {\n          id: 2,\n          text: \"Plays the drums left-handed with a right-handed drum set.\"\n        },\n        {\n          id: 3,\n          text: \"Nominated for one Daytime Emmy Award, but did not win\"\n        }\n      ]);\n    }, 3000 * Math.random());\n  });\n}\n"
		}
	]
};
var solved = {
	files: [
		{
			name: "main",
			content: "import { render } from \"solid-js/web\";\nimport { Suspense } from \"solid-js\";\n\nimport fetchProfileData from \"./mock-api\";\nimport ProfilePage from \"./profile\";\n\nconst App = () => {\n  const { user, posts, trivia } = fetchProfileData();\n  return (\n    <Suspense fallback={<h1>Loading...</h1>}>\n      <ProfilePage user={user()} posts={posts()} trivia={trivia()} />\n    </Suspense>\n  );\n};\n\nrender(App, document.getElementById(\"app\"));\n"
		},
		{
			name: "profile",
			content: "import { For, Suspense, SuspenseList } from \"solid-js\";\n\nconst ProfileDetails = (props) => <h1>{props.user?.name}</h1>;\n\nconst ProfileTimeline = (props) => (\n  <ul>\n    <For each={props.posts}>{(post) => <li>{post.text}</li>}</For>\n  </ul>\n);\n\nconst ProfileTrivia = (props) => (\n  <>\n    <h2>Fun Facts</h2>\n    <ul>\n      <For each={props.trivia}>{(fact) => <li>{fact.text}</li>}</For>\n    </ul>\n  </>\n);\n\nconst ProfilePage = (props) => (\n  <SuspenseList revealOrder=\"forwards\" tail=\"collapsed\">\n    <ProfileDetails user={props.user} />\n    <Suspense fallback={<h2>Loading posts...</h2>}>\n      <ProfileTimeline posts={props.posts} />\n    </Suspense>\n    <Suspense fallback={<h2>Loading fun facts...</h2>}>\n      <ProfileTrivia trivia={props.trivia} />\n    </Suspense>\n  </SuspenseList>\n);\n\nexport default ProfilePage;"
		},
		{
			name: "mock-api",
			content: "import { createResource } from \"solid-js\";\n\nexport default function fetchProfileData() {\n  const [user] = createResource(fetchUser);\n  const [posts] = createResource(fetchPosts);\n  const [trivia] = createResource(fetchTrivia);\n  return { user, posts, trivia };\n}\n\nfunction fetchUser() {\n  console.log(\"fetch user...\");\n  return new Promise((resolve) => {\n    setTimeout(() => {\n      console.log(\"fetched user\");\n      resolve({\n        name: \"Ringo Starr\"\n      });\n    }, 500);\n  });\n}\n\nlet ringoPosts = [\n  {\n    id: 0,\n    text: \"I get by with a little help from my friends\"\n  },\n  {\n    id: 1,\n    text: \"I'd like to be under the sea in an octupus's garden\"\n  },\n  {\n    id: 2,\n    text: \"You got that sand all over your feet\"\n  }\n];\n\nfunction fetchPosts() {\n  let ringoPostsAtTheTime = ringoPosts;\n  console.log(\"fetch posts...\");\n  return new Promise((resolve) => {\n    setTimeout(() => {\n      console.log(\"fetched posts\");\n      resolve(ringoPostsAtTheTime);\n    }, 3000 * Math.random());\n  });\n}\n\nfunction fetchTrivia() {\n  console.log(\"fetch trivia...\");\n  return new Promise((resolve) => {\n    setTimeout(() => {\n      console.log(\"fetched trivia\");\n      resolve([\n        {\n          id: 1,\n          text:\n            'The nickname \"Ringo\" came from his habit of wearing numerous rings.'\n        },\n        {\n          id: 2,\n          text: \"Plays the drums left-handed with a right-handed drum set.\"\n        },\n        {\n          id: 3,\n          text: \"Nominated for one Daytime Emmy Award, but did not win\"\n        }\n      ]);\n    }, 3000 * Math.random());\n  });\n}\n"
		}
	]
};
var markdown = "Sometimes you have multiple `Suspense` Components that you want to coordinate. One possible approach is to put everything under a single `Suspense`, but that limits us to a single loading behavior. A single fallback state means that everything always needs to wait until the last thing is loaded. Instead, Solid introduces the `SuspenseList` Component to coordinate that.\n\nConsider having multiple `Suspense` components like our example. If we wrap them with a `SuspenseList` configured with `revealOrder` of `forwards`, they will render in the order they appear in the tree regardless of the order they load. This reduces the page jumping around. You can set `revealOrder` to `backwards` or `together`, which, respectively, reverses the order or waits for all Suspense Components to load. In addition there is a `tail` option that can be set to `hidden` or `collapsed`. This overrides the default behavior of showing all fallbacks with either showing none or showing the next one in the direction set by `revealOrder`.\n\nOur example currently is a bit of a mess in terms of loading placeholders. While it loads all the data independently we are often showing multiple placeholders depending on the order data loads in. Let's wrap our `ProfilePage` component's JSX in a `<SuspenseList>`:\n\n```jsx\n<SuspenseList revealOrder=\"forwards\" tail=\"collapsed\">\n  <ProfileDetails user={props.user} />\n  <Suspense fallback={<h2>Loading posts...</h2>}>\n    <ProfileTimeline posts={props.posts} />\n  </Suspense>\n  <Suspense fallback={<h2>Loading fun facts...</h2>}>\n    <ProfileTrivia trivia={props.trivia} />\n  </Suspense>\n</SuspenseList>\n```\n";
var async_suspense_list = {
	lesson: lesson,
	solved: solved,
	markdown: markdown
};

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