mirror of https://github.com/sveltejs/svelte
parent
10dfa18d55
commit
00f710d06a
@ -0,0 +1,14 @@
|
|||||||
|
<script>
|
||||||
|
let count = 0;
|
||||||
|
let run = true;
|
||||||
|
$: console.log(count);
|
||||||
|
$: if (count > 10 && run) {
|
||||||
|
alert('too high')
|
||||||
|
}
|
||||||
|
$: {
|
||||||
|
console.log('foo');
|
||||||
|
if (x) break $;
|
||||||
|
console.log('bar');
|
||||||
|
}
|
||||||
|
$: $count = 1;
|
||||||
|
</script>
|
@ -0,0 +1,22 @@
|
|||||||
|
<script>
|
||||||
|
import { run as run_1 } from 'svelte/legacy';
|
||||||
|
|
||||||
|
let count = 0;
|
||||||
|
let run = true;
|
||||||
|
run_1(() => {
|
||||||
|
console.log(count);
|
||||||
|
});
|
||||||
|
run_1(() => {
|
||||||
|
if (count > 10 && run) {
|
||||||
|
alert('too high')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
run_1(() => {
|
||||||
|
console.log('foo');
|
||||||
|
if (x) return;
|
||||||
|
console.log('bar');
|
||||||
|
});
|
||||||
|
run_1(() => {
|
||||||
|
$count = 1;
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Reference in new issue