plainfp - v0.1.0
    Preparing search index...

    Function getOr

    • Await a ResultAsync and extract the success value, falling back to fallback on err.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • T
      • E

      Parameters

      Returns Promise<T>

      const prefs = await pipe(
      loadUserPrefs(userId),
      ResultAsync.getOr(defaultPrefs),
      )
    • Await a ResultAsync and extract the success value, falling back to fallback on err.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • T

      Parameters

      • fallback: T

      Returns <E>(ra: ResultAsyncType<T, E>) => Promise<T>

      const prefs = await pipe(
      loadUserPrefs(userId),
      ResultAsync.getOr(defaultPrefs),
      )