storybook/docs/snippets/common/storybook-preview-global-loader.js.mdx
2021-07-02 21:29:08 +01:00

11 lines
212 B
Plaintext

```js
// .storybook/preview.js
import fetch from 'node-fetch';
export const loaders = [
async () => ({
currentUser: await (await fetch('https://jsonplaceholder.typicode.com/todos/1')).json(),
}),
];
```