I'm trying to create an class decorator that simply adds a function (or property really) to a class, but having no joy.

const findDecorator = () => { return (constructor) => { constructor.prototype.findMe = () => console.log('You found me!') } }

I've also tried using a target.prototype pattern and some other things, but to no use. Does anyone have a simple example of how to do this? By the way, I am also extending a class:

@findDecorator() export default class MyClass extends OtherClass { shouldFireFirst () { this.findMe() } }

EDIT: Actually, it looks like the issue is that the function is available on the instance, but not in the class declaraction.