-
Hi! Where would I put (typically async) logic that needs to exist only whilst a particular component is alive? I notice that an In the react world, I would set up some timers which sync with a server when a particular component was open by starting the timer on the A concrete use-case might be that I want to tail the server log, so I want a timer refreshing the page every X seconds, but only whilst the "Server Log" component is activated. How would I achieve the same here? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I haven't put much thought about the init method being in the component. This could also be achieved using the |
Beta Was this translation helpful? Give feedback.
I haven't put much thought about the init method being in the component. This could also be achieved using the
on_mount
event, however, there is noon_unmount
event. The yew framework would probably suit your needs much better, since it follows react's design pattern.