rexfordessilfie / nextwrappers

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

feat: explore generic wrapper #20

Closed rexfordessilfie closed 1 year ago

rexfordessilfie commented 1 year ago

Overview

Explores adding a type-safe generic wrapper that can be applied to any kind of function without the needing to repeat wrapping logic for each kind of function (args x return) combination.

Changes

Closes #19

rexfordessilfie commented 1 year ago

Closing this to move to a new repository after some more thought. I will be moving this to a new repository to rework it a bit more and to have a standalone reusable wrapper library that can be used in a many different contexts, including within next.js, and all in a type-safe manner, compared to existing JS solutions. After looking round, use-cases that come to mind for useful wrappers include throttle, debounce and more. See https://github.com/tournament-js/wrappers/blob/master/wrappers.js for example