storybook/docs/snippets/web-components/loader-story.js.mdx
Kyle Gach b97d94e005 Address feedback
- Newline following filename comment
- Fix URLs in comments
- Ensure consistent usage of `ts` vs `tsx` language
2023-01-12 14:17:39 -07:00

22 lines
395 B
Plaintext

```js
// TodoItem.stories.js
import fetch from 'node-fetch';
export default {
title: 'Examples/Loader'
component: 'demo-todo-item',
render: (args, { loaded: { todo } }) => TodoItem({...args, ...todo}),
};
export const Primary = {
loaders: [
async () => ({
todo: await (
await fetch('https://jsonplaceholder.typicode.com/todos/1')
).json(),
}),
],
};
```