I have a generic function which is supposed to broadcast the contents of a given type to whoever cares to receive it.
something like
function broadcast(J:Record<string,unknown>){...}
but when I got to apply a specific type to that function I get an error e.g.
interface foo
{
thing: string;
}
const a:foo={thing:'wow'};
broadcast(a); // error that I am not using a specific type but broadcast doesn't care.
I have figured out I can unwrap the type like so:
broadcast((a as unknown) as Record<string,unknown>)
but I think there is a better way.