We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the current version of the torque API, Loader and Renderer simply use the any type to describe the loader data.
torque
Loader
Renderer
any
type Loader interface { Load(req *http.Request) (any, error) } type Renderer interface { Render(wr http.ResponseWriter, req *http.Request, loaderData any) error }
It would be great for API ergonomics to be able to declare them using a generic combination interface:
Illustration:
type GenericRenderer[T any] interface { Load(req *http.Request) (T, error) Render(wr http.ResponseWriter, req *http.Request, loaderData T) error }
Rough outline of solution:
handleLoader
handleRenderer
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In the current version of the
torque
API,Loader
andRenderer
simply use theany
type to describe the loader data.It would be great for API ergonomics to be able to declare them using a generic combination interface:
Illustration:
Rough outline of solution:
handleLoader
andhandleRenderer
in server.go to support the new interface type. This may or may not be possible with the generic type.The text was updated successfully, but these errors were encountered: