Implementing conditional behaviour to useAction hook #266
merthanmerter
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
Hi, as you said, they're not really meant to fetch data, route handlers should be used for that instead. Though, since |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Some may think server actions are not meant to be fetching client side data but I personally find them useful when combined with middlewares and revalidating data with state hooks instead of search queries etc.
That said, would it be possible to introduce something like "shouldFetch / shouldTrigger" parameter to conditionally trigger the action with useAction hook?
By the way, this works;
Beta Was this translation helpful? Give feedback.
All reactions