How to modify a type in a decorator? #8003
Unanswered
vpzomtrrfrt
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You can just modify the decorator target. We do that for a few decorators Is it safe?It depends on what you are doing. If you are just modifying exactly that target and its direct properties it is most likely fine. If however you start mutating sub types or other things it will very likely have issues. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation on creating decorators describes how to set metadata, but not how to modify the type itself.
How is that meant to be done? Is it safe/meaningful to modify the target value or do I need to return a new type somehow?
Beta Was this translation helpful? Give feedback.
All reactions