Given
class BaseClass{
count:number=0;
public someMethod=():void =>{
this.count++;
}
}
class ChildClass extends BaseClass{
public someMethod=():void=>{
super.someMethod();
//Do more work here.
}
}
I receive the error message:
Only public methods of the base class are accessible via the 'super' keyword.
@Basarat provides some information here but this seems like a real hack to the language. typescript arrow operator to define a function on prototype
How might this be done while preserving contextual use of 'this'?
Am I using arrow functions properly or should they really only be used as a method of declaring something like a callback?