mirror of https://github.com/sveltejs/svelte
fix: ensure element effects are executed in the correct order (#14038)
parent
3fe278a8c3
commit
253d01ec29
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure element effects are executed in the correct order
|
@ -0,0 +1,7 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
async test({ assert, logs }) {
|
||||
assert.deepEqual(logs, [0, 1, 2, 3, 4, 5, 6]);
|
||||
}
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
<script>
|
||||
function create_action() {
|
||||
let index = 0;
|
||||
return () => {
|
||||
console.log(index++);
|
||||
};
|
||||
}
|
||||
|
||||
const content = create_action();
|
||||
</script>
|
||||
|
||||
{#if true}
|
||||
<div use:content></div>
|
||||
{/if}
|
||||
|
||||
<div use:content></div>
|
||||
|
||||
{#each { length: 5 } as _}
|
||||
<div>
|
||||
<div use:content></div>
|
||||
</div>
|
||||
{/each}
|
Loading…
Reference in new issue