I'm using extended class in my code and I found that this use case doesn't work.
I can only call method passed as parameter, if my method call methods from the current or extended object it fails
import { tryit } from 'radash';
class Foo {
protected foo() {
return 'foo';
}
}
class Bar extends Foo {
bar() {
return this.foo();
}
}
const work = () => {
console.log(new Bar().bar());
};
const fail = () => {
const [err, result] = tryit(new Bar().bar)();
if (err) throw err;
};
work(); // foo
fail(); // Error: Cannot read properties of undefined (reading 'foo')
I'm using extended class in my code and I found that this use case doesn't work. I can only call method passed as parameter, if my method call methods from the current or extended object it fails