diff --git a/docs/snippets/common/storybook-preview-global-loader.js.mdx b/docs/snippets/common/storybook-preview-global-loader.js.mdx index 2e0fe2398059..2b7d8f057d48 100644 --- a/docs/snippets/common/storybook-preview-global-loader.js.mdx +++ b/docs/snippets/common/storybook-preview-global-loader.js.mdx @@ -5,7 +5,7 @@ import fetch from 'node-fetch'; export const loaders = [ async () => ({ - currentUser: await (await fetch('https://jsonplaceholder.typicode.com/todos/1')).json(), + currentUser: await (await fetch('https://jsonplaceholder.typicode.com/users/1')).json(), }), ]; ``` \ No newline at end of file diff --git a/docs/snippets/svelte/loader-story.js.mdx b/docs/snippets/svelte/loader-story.js.mdx index 87977a4c083a..7fc57ea8be6a 100644 --- a/docs/snippets/svelte/loader-story.js.mdx +++ b/docs/snippets/svelte/loader-story.js.mdx @@ -15,7 +15,7 @@ export const Primary = (args, { loaded: { todo } }) => ({ props: { ...args, ...todo }, }); -Primaryloaders = [ +Primary.loaders = [ async () => ({ todo: await (await fetch('https://jsonplaceholder.typicode.com/todos/1')).json(), }), diff --git a/docs/snippets/vue/loader-story.3.js.mdx b/docs/snippets/vue/loader-story.3.js.mdx index f8a7739a6ec0..fd8c09308512 100644 --- a/docs/snippets/vue/loader-story.3.js.mdx +++ b/docs/snippets/vue/loader-story.3.js.mdx @@ -20,7 +20,7 @@ export const Primary = (args, { loaded: { todo } }) => { }; }; -SampleStory.loaders = [ +Primary.loaders = [ async () => ({ todo: await (await fetch('https://jsonplaceholder.typicode.com/todos/1')).json(), }), diff --git a/docs/writing-stories/loaders.md b/docs/writing-stories/loaders.md index 6dd9c9e5e2ee..c84de903cad5 100644 --- a/docs/writing-stories/loaders.md +++ b/docs/writing-stories/loaders.md @@ -31,7 +31,7 @@ Loaders are helpful when you need to load story data externally (e.g., from a re -The response obtained from the remote API call is combined into a `loaded` field on the story context, which is the second argument to a story function. For example, in React, the story's args were spread first to prioritize them over the static data provided by the loader. Other frameworks will not need such requisite. +The response obtained from the remote API call is combined into a `loaded` field on the story context, which is the second argument to a story function. For example, in React, the story's args were spread first to prioritize them over the static data provided by the loader. With other frameworks (e.g., Angular), you can write your stories as you'd usually do. ## Global loaders