@svelte-put/async-stack
Type-safe and headless async builder for async component stack (notification and modal/dialog systems, for example)
svelte-put
This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.
Usage & Documentation
See the dedicated documentation page here.
Quick Start
<script lang="ts">
import { stack } from '@svelte-put/async-stack';
import MyComponent from './MyComponent.svelte';
export const myStack = stack()
.addVariant('my', MyComponent)
.addVariant('special', {
timeout: false,
id: 'counter',
component: MyComponent,
props: {
special: true,
content: 'A very special thing',
},
})
.build();
onMount(async () => {
const pushed = myStack.push('special');
const { userAction } = await pushed.resolution;
notiStack.push('info', {
props: {
content: 'An example information',
},
});
});
</script>
</div>
{/each}
</aside>