I have currently:
A Class with multiple functions A Decorator that saves the function to a list
The problem:
When i call the function “this” is not the class ( or not yet initialized )
How can i implement it correctly?
My Class Function Decorator:
export function LemmyOn(data: ILemmyOn) {
return function (
target: Object,
propertyKey: string | symbol,
descriptor: TypedPropertyDescriptor<any>
) {
events.push({ data: data, fn: descriptor.value });
return descriptor;
};
}
!typescript
!typescript@programming.dev
(Testing testing, 1 2 3…)
@rmam Wow, this looks a bit broken on Mastodon… but it’s still clickable.