Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniebigodes committed Jul 5, 2021
1 parent 5715718 commit e673030
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}),
];
```
2 changes: 1 addition & 1 deletion docs/snippets/svelte/loader-story.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}),
Expand Down
2 changes: 1 addition & 1 deletion docs/snippets/vue/loader-story.3.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}),
Expand Down
2 changes: 1 addition & 1 deletion docs/writing-stories/loaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Loaders are helpful when you need to load story data externally (e.g., from a re

<!-- prettier-ignore-end -->

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

Expand Down

0 comments on commit e673030

Please sign in to comment.