DEV Community

Discussion on: My random thoughts on Svelte

Collapse
 
pavelloz profile image
Paweł Kowalski • Edited

I would like svelte to be more reactive, something like array.push could trigger render.

It is. Read about reactive statements. svelte.dev/docs#component-format-s...

Collapse
 
gf_developer profile image
GF

As far as I understand, mutate methods like ‘array.push’ won’t trigger updates. Take a look there svelte.dev/tutorial/updating-array...

Collapse
 
alekseiberezkin profile image
Aleksei Berezkin

After push you may write like array = array 😉 This works and even is suggested by tutorials

Thread Thread
 
gf_developer profile image
GF • Edited

Exactly! But my point is to avoid an additional assignment; I believe the comiler could do it.