storybook/docs/snippets/svelte/storybook-preview-global-loader.js.mdx

12 lines
207 B
Plaintext

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