Swiftybase
Function StackOption & Result

Option Unwrap or Else

This function stack unwraps the value inside the option. If the option is empty (i.e., contains no value), it computes a new value using the provided function.

Configuration:

Value: The optional value to unwrap.
Fallback Function: A function to compute a value when the option contains no value.

On this page