So it’s typescript’s magic that translates a union that resulted from a mathematical point of view into a single type that all the other types are assignable to.
So, without typescript, I’d get { { xyz, foo }, { xyz, bar } }, but after typescript weighs in, the resulted type will only be { xyz: string }.
I think I finally understood it!
So it’s typescript’s magic that translates a union that resulted from a mathematical point of view into a single type that all the other types are assignable to.
So, without typescript, I’d get
{ { xyz, foo }, { xyz, bar } }
, but after typescript weighs in, the resulted type will only be{ xyz: string }
.I hope I got it right.
Thank you!
Yeah, I think you've got it right :)