#Decorator-Factory override constructor
6 messages · Page 1 of 1 (latest)
6 messages · Page 1 of 1 (latest)
Let's say we got a function decorator
export function someDecorator() {
return (target, key) => {
target.consturctor = () => { // do some stuff here }
}
}
I have to use class decorator in order to override the constructor of target ?
Decorator-Factory override constructor
found another way of doing what i wanted (extending the class and use super to do extra stuff) but tbh there might be examples where i cant do this. Any ideas?