ts-helpers
ts-helpers copied to clipboard
variance modifier wrapper function
sometimes you need to write a function with the old function syntax (eg. to access super or to make a generator) but still want to leverage the variance checks that arrow functions have
something like
class Foo {
foo = toArrowFunction(function() {
super.foo()
})
}
(idk if this will work)
that example doesn't work because it needs to be a method not a function