rexfordessilfie / nextwrappers

Reusable, composable middleware-like wrappers for Next.js App Router Route Handlers and Middleware.
MIT License
24 stars 0 forks source link

Add wrappers for server actions #16

Closed rexfordessilfie closed 1 month ago

rexfordessilfie commented 1 year ago

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.