mirror of https://github.com/sveltejs/svelte
breaking: rename $effect.active to $effect.tracking (#12022)
* breaking: rename $effect.active to $effect.tracking * update type * add more helpful error * tweak changeset * fix prettier config --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/12015/head
parent
9dc2d71a12
commit
ccb3c90cd5
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
breaking: rename `$effect.active` to `$effect.tracking`
|
@ -1,11 +0,0 @@
|
||||
<script>
|
||||
const foo = $effect.active();
|
||||
let bar = $state(false);
|
||||
$effect.pre(() => {
|
||||
bar = $effect.active();
|
||||
});
|
||||
</script>
|
||||
|
||||
<p>{foo}</p>
|
||||
<p>{bar}</p>
|
||||
<p>{$effect.active()}</p>
|
@ -0,0 +1,14 @@
|
||||
<script>
|
||||
import {untrack} from 'svelte';
|
||||
|
||||
const foo = $effect.tracking();
|
||||
let bar = $state(false);
|
||||
$effect.pre(() => {
|
||||
bar = $effect.tracking();
|
||||
});
|
||||
</script>
|
||||
|
||||
<p>{foo}</p>
|
||||
<p>{bar}</p>
|
||||
<p>{$effect.tracking()}</p>
|
||||
<p>{untrack(() => $effect.tracking())}</p>
|
Loading…
Reference in new issue