dohn
Explore posts from serversWhat's the correct way to wrap server functions?
thanks for your help!
a practical example in this case is basically how to craft a function like
createAuthenticatedAction
that wraps action
from solid-router
so that i dont have to always do auth checks inside each action (which i've been doing for like 50 actions already)
i figured out a way which is defining the actual implementation of the action in a separate file with a top-level "use server" and using the single export inside action
, so that works. only annoying thing is that i need to split two files just to create an action8 replies
What's the correct way to wrap server functions?
from my understanding "use server" should only make a function an RPC, and it should only do it if you're not on the server already (otherwise it's just invoked) so my reasoning is I need a "use server" both inside my helper and inside the callback I pass to it, but that makes the compiler completely hang when I actually trying using it inside a form, the page will not load at all but no errors are logged to the console
8 replies
Do something when a submission ends if there's more than 1 action
@Maciek50322 Thanks for your response! Note I'm talking about
useSubmission
exported by solid router, not a custom hook. Your example is pretty much the case, except with two useSubmission using a form and a formAction
on a button to trigger different server actions.
13 replies
How to debug Node memory allocation errors?
this looks like the related issue: https://github.com/nuxt/nuxt/issues/25115 closing this since issues are being opened about it
4 replies