The concept of wrappers can easily be applied to Server Actions as well to perform cross cutting tasks for server actions. Similar to route handler wrappers, server action wrappers could handle tasks such as validation (already being done with zact!), or even logging with a trace ID can also be done here. The same composition patterns with merge, stack, chain could also be utilized here.
The concept of wrappers can easily be applied to Server Actions as well to perform cross cutting tasks for server actions. Similar to route handler wrappers, server action wrappers could handle tasks such as validation (already being done with
zact
!), or even logging with a trace ID can also be done here. The same composition patterns withmerge
,stack
,chain
could also be utilized here.