Function as signal value
Using the accessor of
createSignal<null | (x:any)=>...>() doesn't work as expected. I need to wrap the function in an array or object for it to become callable. What's the purpose of that behavior?5 Replies
i think ur probably getting tripped up by the
Setter
the setter also accept a function:setSignal(prev => ...)
so if you want to set a function you have to do setSignal(() => (x: any) => ...)Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
this is handy, for example to prevent infinite loops:
thanks!
Ur very welcome!