cant set signal exported from a context
I've recreated a simple example based on my code: https://stackblitz.com/edit/solidjs-templates-dhbcft?file=src%2Fcomponents%2Fcontext.tsx,src%2Fcomponents%2FCardWrapper.tsx
In
context.tsx
I have a signal inTransit
which tells if some HTTP request is in progress. It works fine in the submit
function which is in the context, but when I use setInTransit
in a createEffect
in another component (CardWrapper.tsx
), it does not works as expected.
What I expect is to keep seeing "Processing..." till the createEffect
in CardWrapper.tsx
is also done executing after clicking the submit button.
Any help or hints would be appreciated, thanks!3 Replies
i guess it's due to async
signals and async do not match well
in an async effect, all signals after the first await will not auto-subscribe the effect
the best explanation to the why is watching the implementation: https://www.youtube.com/watch?v=UhGV8yYnvQE
JavaScript Conferences by GitNation
YouTube
SolidJS: Reactivity Unchained – Ryan Carniato, JSNation 2022
JSNation Conference 2022 #JSNation #GitNation
Website – https://jsnation.com/
Follow the link to watch the full version of all the conference talks, QnA’s with speakers and hands-on workshop recordings → https://portal.gitnation.org/events/jsnation-2022
Talk: SolidJS: Reactivity Unchained
Join Ryan Carniato, creator of SolidJS, as he shows off...
Thanks. Will take a look