how to use a typescript decorator and initialize the class
how to use a typescript decorator and initialize the class
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; }; }
Hi there! Looks like you linked to a Lemmy community using a URL instead of its name, which doesn't work well for people on different instances. Try fixing it like this: !typescript@programming.dev
Hi @rikudou, your bot incorrectly flags for Mastodon users. I have to tag the community in my post, or it won't federate. And Mastodon tags seem to look like URLs to the bot.
@programming