Skip to content

bridge-result

{/* @generated by scripts/sync-content.mjs; do not edit */}

@sandlada/result/bridge-result — lifts a sync IResultOfT<T, E> into Promise<IResultOfT<…>> using async callbacks. Input is always a plain Result; output is always a Promise of Result. Same export names as operators/map and friends, but a different subpath and carrier type.

  • Operates on: synchronous IResultOfT<T, E>; callbacks return Promise<…>.
  • Execution model: eager — calling the operator starts the returned Promise immediately.
  • Not here: eager pipelines over a resolved Result promise (promise-result), lazy thunks (async-result), or sync operators (operators).
Export Description Source
map Async map on a sync Result. map.ts
bind Async bind on a sync Result. bind.ts
bindThrough Async side step that keeps the original success value. bindThrough.ts
match Async terminal match on a sync Result. match.ts
orElse Async recovery on a sync Result. orElse.ts
tap Async side effect on success. tap.ts
tapErr Async side effect on failure. tapErr.ts
  • Throw policy matches the former promise-result lift family; see behavior-modes.md §4.6.1.
  • bind / match / orElse propagate synchronous handler throws via Promise rejection; map / bindThrough / tap / tapErr capture to Err.