Union2Methods<A, B> extension

The methods on Union2.

on

Methods

join<T>(T first(A value), T second(B value)) → T
Transform all the potential types that value can take into a single unique type.
map<A2, B2>(A2 first(A value), B2 second(B value)) Union2<A2, B2>
Transforms a union into another union of potentially different types.
switchCase(void first(A value)?, void second(B value)?) → void
Allow executing custom logic based on the value type in a type safe way.