Function ifOk

  • Conditionally run function if value is an ok result

    Type Parameters

    • T

      The value type of the Ok result.

    Parameters

    • value: Result<T, unknown>

      Value to check

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

      Function to run if value is an ok result

    Returns ReturnType<typeof fn> | void