Function ifOkOr

  • Conditionally run ok and err functions if value is an ok or err result

    Type Parameters

    • T

      The value type of the Ok result.

    Parameters

    • value: Result<T, unknown>

      Value to check

    • okFn: (value: T) => void | Promise<void>

      Function to run if value is an ok result

    • errFn: (value: unknown) => void | Promise<void>

      Function to run if value is an err result

    Returns void | Promise<void>