mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
- Newline following filename comment - Fix URLs in comments - Ensure consistent usage of `ts` vs `tsx` language
22 lines
395 B
Plaintext
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(),
|
|
}),
|
|
],
|
|
};
|
|
```
|