storing a function inside a store
is it currently possible to store a function inside a store? it seems like they are being called immediately when I enter them in a store atm.
https://playground.solidjs.com/anonymous/a8dcab94-f01e-48f0-9959-432cc6152de7
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
6 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
it seems to be solved easily by doing
setState('test', () => test);
🖇️
I thought I would get type-errors, but ts doesn't complain
aa realize now why they are called immediately, because a function is also used as a storesetter.Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
too late, dammit
still learned a thing: didnt know how to do optional function call before
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View