export function Reads(...message_type_args: Type<Message>[]) {
return <T extends new(...args: any[]) => {}>(constructor: T) => {
return class extends constructor {
protected read_message_types = new Set<Type<Message>>(message_type_args);
};
};
}
@Reads(AMessage)
class AMessageReaderEngine extends Engine {}
I am using the following decorator pattern in my framework. It would be really nice if I could support it on the Lua side instead of having to declare the properties directly in the class, I find this much more readable.
I am using the following decorator pattern in my framework. It would be really nice if I could support it on the Lua side instead of having to declare the properties directly in the class, I find this much more readable.