mirror of https://github.com/sveltejs/svelte
fix: ensure user effects are correctly executed on initialisation (#13697)
parent
ae10f4d37c
commit
2ca9a81679
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure user effects are correctly executed on initialisation
|
@ -0,0 +1,7 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
async test({ assert, logs }) {
|
||||
assert.deepEqual(logs, ['effect 1', 'effect 2']);
|
||||
}
|
||||
});
|
@ -0,0 +1,15 @@
|
||||
<script>
|
||||
$effect.pre(() => {
|
||||
$effect(() => {
|
||||
console.log('effect 1')
|
||||
})
|
||||
})
|
||||
|
||||
function template() {
|
||||
$effect(() => {
|
||||
console.log('effect 2')
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{template()}
|
Loading…
Reference in new issue