mirror of https://github.com/sveltejs/svelte
parent
80b713a85e
commit
0dc84ab2a2
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
let { count } = $props();
|
||||||
|
|
||||||
|
async function x() {
|
||||||
|
let d = $derived(await new Promise((f) => {}));
|
||||||
|
}
|
||||||
|
|
||||||
|
let indirect = $derived(x() && count);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p>{indirect}</p>
|
@ -0,0 +1,14 @@
|
|||||||
|
import { flushSync, tick } from 'svelte';
|
||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
async test({ assert, target }) {
|
||||||
|
await tick();
|
||||||
|
assert.htmlEqual(target.innerHTML, '<button>0</button><p>0</p>');
|
||||||
|
|
||||||
|
const button = target.querySelector('button');
|
||||||
|
|
||||||
|
flushSync(() => button?.click());
|
||||||
|
assert.htmlEqual(target.innerHTML, '<button>1</button><p>1</p>');
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,17 @@
|
|||||||
|
<script>
|
||||||
|
import Child from './Child.svelte';
|
||||||
|
|
||||||
|
let count = $state(0);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<button onclick={() => count += 1}>{count}</button>
|
||||||
|
|
||||||
|
<svelte:boundary>
|
||||||
|
<Child {count} />
|
||||||
|
|
||||||
|
{#snippet pending()}
|
||||||
|
<p>pending</p>
|
||||||
|
{/snippet}
|
||||||
|
</svelte:boundary>
|
||||||
|
|
||||||
|
{console.log(`outside boundary ${count}`)}
|
Loading…
Reference in new issue