mirror of https://github.com/sveltejs/svelte
chore: update/simplify test (#16630)
* update/simplify test * oops * simplify effect-order-7pull/16633/head
parent
95e5175581
commit
7b2d774627
@ -1,11 +1,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import B from './B.svelte';
|
import B from './B.svelte';
|
||||||
|
|
||||||
let { boolean, closed } = $props();
|
let { boolean, closed, close } = $props();
|
||||||
|
|
||||||
|
// this runs after the effect in B, because child effects run first
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
console.log(boolean);
|
console.log({ boolean, closed });
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<B {closed} />
|
<B {closed} {close} />
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
<script module>
|
|
||||||
let object = $state();
|
|
||||||
|
|
||||||
export function open() {
|
|
||||||
object = { boolean: true };
|
|
||||||
}
|
|
||||||
|
|
||||||
export function close() {
|
|
||||||
object = undefined;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
let { children } = $props();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if object?.boolean}
|
|
||||||
<!-- error occurs here, this is executed when the if should already make it falsy -->
|
|
||||||
{@render children(object.boolean)}
|
|
||||||
{/if}
|
|
@ -1,9 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import B from './B.svelte';
|
import B from './B.svelte';
|
||||||
|
|
||||||
let { boolean, closed } = $props();
|
let { boolean, closed, close } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span>{boolean}</span>
|
<span>{boolean} {closed}</span>
|
||||||
|
|
||||||
<B {closed} />
|
<B {closed} {close} />
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
<script module>
|
|
||||||
let object = $state();
|
|
||||||
|
|
||||||
export function open() {
|
|
||||||
object = { nested: { boolean: true } };
|
|
||||||
}
|
|
||||||
|
|
||||||
export function close() {
|
|
||||||
object = undefined;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
let { children } = $props();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if object?.nested}
|
|
||||||
<!-- error occurs here, this is executed when the if should already make it falsy -->
|
|
||||||
{@render children(object.nested)}
|
|
||||||
{/if}
|
|
Loading…
Reference in new issue