loading...

re: Svelte tutorial note VIEW POST

FULL DISCUSSION
 

But I tried it without $ prefix as shown below but still works.

export const elapsed = derived(
    time,
    t => Math.round((t - start) / 1000)
); 

The $ prefix is used to show that the variable is observable, you can omit it

 

Thank you for the confirmation of the behavior.

Oh yes. as that got me confused, I asked and someone replied that even Svelte test code uses the callback without $.

reddit.com/r/sveltejs/comments/hbl...

code of conduct - report abuse