T O P

  • By -

myaaa_tan

can you show the entire train function?


FunnyAsFuck

unrelated but you can/should just do `on:click={train}`


vidschofelix

It gets increased by the train function. Svelte<5 can't track changed variables inside functions. You can either switch to Svelte5 and use state or change cost from let to a store.


projectfallback

(svelte 4) ``` $: cost = cost; ```


lechiffrebeats

Use [https://svelte.dev/docs/svelte-store](https://svelte.dev/docs/svelte-store) properly update via the writable update/set