Skip to content

Instantly share code, notes, and snippets.

@saintsGrad15
Created June 13, 2025 18:06
Show Gist options
  • Save saintsGrad15/61ef69e877ea3b7e0b0f5bcfe8756f43 to your computer and use it in GitHub Desktop.
Save saintsGrad15/61ef69e877ea3b7e0b0f5bcfe8756f43 to your computer and use it in GitHub Desktop.
A basic TS decorator implementation
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