Created
June 13, 2025 18:06
-
-
Save saintsGrad15/61ef69e877ea3b7e0b0f5bcfe8756f43 to your computer and use it in GitHub Desktop.
A basic TS decorator implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function practiceDecorator(target, propertyKey, descriptor) { | |
return { | |
...descriptor, | |
value(...args) { | |
// Do something here when the decorated function is called | |
return descriptor.value.apply(this, args); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment