How to simplify $:
code?:
Symbol.svelte
<script>
export let symbol;
$:c = symbol.c;
$:name = symbol.name;
$:{console.log("log Symbol", name, c)}
</script>
<div on:click={()=>symbol.c=0} >
{name} {c}
</div>
I dream of something like:
export let symbol;
$:{c,name} = symbol;
I can't use...
export let c,name;
...because in on:click
I have to modify the symbol
object with symbol.c = 0
- without this my store
named list
will not update.
The whole example: https://svelte.dev/repl/37e3a1fa96fc4f1dbc7cfcafb1edc439?version=3.22.1
PS, If you can use export let c, name;
without losing the store
update, please specify how to do it.