You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/packages/svelte/tests/runtime-runes/samples/async-attach-blockers/main.svelte

18 lines
439 B

<script>
import Child from "./Child.svelte";
// Wait a macrotask to make sure the effect doesn't run before the microtask-Promise.resolve() resolves, masking a bug
await new Promise(r => setTimeout(r));
function createAttachment(value) {
return () => {
console.log(value);
};
}
let attachment = $state('ready');
</script>
<div {@attach createAttachment(attachment)}></div>
<Child {@attach createAttachment(attachment)} />