Is there a way to narrow a generic type, a callback, using the value of an enum variable? And then invoke it?
I\'m not sure why the discriminated union is not working