better-returns
    Preparing search index...

    Function then

    • Applies a function that returns an Option to the value of a 'some' Option. This is useful for chaining operations that might return 'none'. If the Option is 'none', it returns a 'none' Option.

      Type Parameters

      • T
      • U

      Parameters

      • option: Option<T>

        The initial Option.

      • apply: (value: T) => Option<U>

        The function to apply to the value if the option is 'some', returning a new Option.

      Returns Option<U>

      A new Option resulting from the application, or a 'none' Option.