onNone method

Option<TValue> onNone(
  1. void onNone()
)

Calls the provided onNone function if the Option is a None instance.

Implementation

Option<TValue> onNone(void Function() onNone) {
  switch (this) {
    case None():
      onNone();
    default:
  }

  return this;
}