Which way to go? Solid Router's action or SolidStart server function
I recently tried SolidStart and now im confused to what should i use to do some server side procedure...
what is the best practice here?
4 Replies
Actions aren't tied to the client or server, they just wrap whatever code you put inside them.
Server functions only run on the server, so you'll definitely want one of them and it's up to you whether you wrap it in action.
when should a server fn be wrapped in action?
hmm i think i get this
If you want to have the benefits that wrapping a function in action gives you
can trigger invalidations and further routing
They handle submissions through POST requests, allowing you to easily use HTML forms to send data.
By using actions, the process of managing and tracking data submissions can be streamlined, reducing the complexity of your application.You'll usually want to wrap most of your mutations with action
yes thank you, that clear my doubts
you see, the beta docs IMO is not that beginner-friendly and it force me to navigate many times just to grasp the general concept of things
anyway, thank you for your time