onrails
    Preparing search index...
    • Error-track bind — runs fn only when the result is Err, allowing a failed workflow to recover to Ok or remap the failure. Mirror of flatMap on the error channel.

      Type Parameters

      • T
      • E
      • F

      Parameters

      Returns Result<T, F>

      recover(networkResult, (e) =>
      e.kind === "rate_limit" ? ok(cachedBody) : err(e),
      );
    • Error-track bind — runs fn only when the result is Err, allowing a failed workflow to recover to Ok or remap the failure. Mirror of flatMap on the error channel.

      Type Parameters

      • T
      • E
      • F

      Parameters

      Returns (result: Result<T, E>) => Result<T, F>

      recover(networkResult, (e) =>
      e.kind === "rate_limit" ? ok(cachedBody) : err(e),
      );