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 returnPromise<…>. - 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 |
Contract notes
Section titled “Contract notes”- Throw policy matches the former
promise-resultlift family; see behavior-modes.md §4.6.1. bind/match/orElsepropagate synchronous handler throws via Promise rejection;map/bindThrough/tap/tapErrcapture toErr.
Related
Section titled “Related”promise-result— eager operators on a Promise of Result.operators— sync operators on plain Result values.