Returns a function that depending on the provided bool value,
invokes and returns the result of either onFalse or onTrue function.
Both onFalse and onTrue must return the same type A.
Returns a function that depending on the provided bool value,
invokes and returns the result of either onFalse or onTrue function.
The return type is Object? because onFalse and onTrue can potentially
return different types.