-
SummaryHi, In my application, I use Server Actions as a replaceable for the api folder where I make external api requests there and I put each actions to its relevant feature: src/ Example
I don't know if this is a good pattern you recommend or it would better to pull all actions in one root file and make the external api request from the api folder Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Just a heads up. When using server actions to fetch data, you are opting into sequential requests. In the client the functions calls are queued, and even if you call them with Promise.all or anything like that, they'll resolve one after the other. The server can of course, process them as needed, there's no queue server side. The primary use of these is to mutate data. |
Beta Was this translation helpful? Give feedback.
Just a heads up. When using server actions to fetch data, you are opting into sequential requests. In the client the functions calls are queued, and even if you call them with Promise.all or anything like that, they'll resolve one after the other.
The server can of course, process them as needed, there's no queue server side.
The primary use of these is to mutate data.