You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decorators and the metadata that they produce are great. As far as I can see this is only supported on classes, class properties and class functions.
I would like to be able to decorate anything. Specifically I would like to decorate a function that is not defined in a class so that at runtime I can get metadata about the types of parameters it expects.
Use Cases
Class metadata can be used by DI systems to inject constructor params. I would like to write code that does the same for a function. Specifically I would like to write a DI system for a React Function component to resolve any parameters (or dependencies) that function has.
Search Terms
function decorators
Suggestion
Decorators and the metadata that they produce are great. As far as I can see this is only supported on classes, class properties and class functions.
I would like to be able to decorate anything. Specifically I would like to decorate a function that is not defined in a class so that at runtime I can get metadata about the types of parameters it expects.
Use Cases
Class metadata can be used by DI systems to inject constructor params. I would like to write code that does the same for a function. Specifically I would like to write a DI system for a React Function component to resolve any parameters (or dependencies) that function has.
Examples
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: