createSignal with preexisting data store?
https://playground.solidjs.com/anonymous/5ab699c2-0e36-470c-9aae-a9fa62d15d75
Seems the UI will not update when the data is updated outside of
createSignal
; how can I add it in my data.tsx
file please?
The timer (while burning) should update the current state to empty when the fuel runs out to 0.
TIASolid Playground
Quickly discover what the solid compiler will generate from your JSX template
5 Replies
Your machine doesn't seem to offer a way to subscribe to state change/transitions. So patching the
trigger
was the only way that the signal can be updated whenever the machine state (potentially) changes.Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
That said if you converted
data.tsx
to a store and published to most recent machine.state
to it as well you could simply use that to drive the UI.Yea, that was my initial reason to have a separate
data.tsx
; so the users can use any type of 'store' they want for the framework they're in.
Exactly how would I do that in Soild please?How does this look to you?
https://playground.solidjs.com/anonymous/57426448-ca9e-4158-8941-bf82372a3897
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template