Documents for @litert/utils-flow-control
    Preparing search index...

    Function useValueOr

    • Try if the value could make check return true, if not, return the elseValue.

      Type Parameters

      • T

      Parameters

      • value: T

        The value to check, if checked successfully, it will be returned.

      • check: (v: T) => boolean

        The check function.

      • elseValue: T

        The value to return if the check fails.

      Returns T