storybook/docs/snippets/common/storybook-preview-global-loader.js.mdx
2021-07-05 19:19:35 +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/users/1')).json(),
}),
];
```