For anyone viewing this for Svelte 5 (Runes), you can do the same with state runes using $effect:
$effect(() => (c, console.log("yes")))
Alternatively, $inspect(...).with if you do not want this to run in production builds.
$inspect(c).with(() => console.log("yes"));