MaybeRecordX<K, J> extension

on

Methods

maybeAsyncCombine<T>({FutureOr<Maybe<T>> firstJust(K)?, FutureOr<Maybe<T>> secondJust(J)?, FutureOr<Maybe<T>> bothJust(K, J)?, FutureOr<Maybe<T>> bothNothing()?}) FutureOr<Maybe<T>>
Use it to asynchronously combine two different Maybe's into a new one. Input firstJust to map case where only the first value is Just, secondJust to map case where only the second value is Just, bothJust to map case where both first and second value are Just and bothNothing to map case where both are Nothing Example:
maybeCombine<T>({Maybe<T> firstJust(K)?, Maybe<T> secondJust(J)?, Maybe<T> bothJust(K, J)?, Maybe<T> bothNothing()?}) Maybe<T>
Use it to combine two different Maybe's into a new one. Input firstJust to map case where only the first value is Just, secondJust to map case where only the second value is Just, bothJust to map case where both first and second value are Just and bothNothing to map case where both are Nothing Example: