6 Replies
Ok why can you be more helpful please.
Answers can't be very helpful if the question doesn't contain information. We have no way to know what problems you are facing that you feel the need to use
setTimeout
everywhere.I don't face any problems, I am worried if I can get timing issues later otherwise it's cool. Maybe there is a system practice to use for this.
In that case it's probably fine. I was reading your original question as that you were doing
setTimeout(() => setState(...), 0)
everywhere, as a hack to solve some state issues.
With setTimeout
(and anything async) you should just be careful that effects might not work as expected: see https://playground.solidjs.com/anonymous/ed7ff235-05d4-40df-8b4c-50e24e89adab will log only once.Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
Here' let me dump you something:
What could go wrong? It's working currently.
I don't so much care about smooth cancellable animations per say, but still nothing should break with this kind of setTimeout madness.
(u can get syntax highlighting with
``tsx)
afaik u have to be careful with effects not working as expected after async boundaries, but i see ur already taking care of that with
on(...`
you basically end up with dependency-arrays
I am not sure how tito's example relates to async