bridge-option
{/* @generated by scripts/sync-content.mjs; do not edit */}
@sandlada/result/bridge-option — lifts a sync IOption<T> into Promise<IOption<…>> using async callbacks. Input is always a plain Option; output is always a Promise of Option. Same export names as option/map, but a different subpath and carrier type.
- Operates on: synchronous
IOption<T>; callbacks returnPromise<…>. - Execution model: eager — calling the operator starts the returned Promise immediately.
- Not here: eager pipelines over a resolved Option promise (
promise-option), lazy thunks (async-option), or sync operators (option).
| Export | Description | Source |
|---|---|---|
map |
Async map on a sync Option. | map.ts |
bind |
Async bind on a sync Option. | bind.ts |
match |
Async terminal match on a sync Option. | match.ts |
orElse |
Async fallback on a sync Option. | orElse.ts |
tap |
Async side effect when Some. | tap.ts |
Contract notes
Section titled “Contract notes”- Promotion family: a synchronous throw becomes
None; an async rejection propagates. See behavior-modes.md §4.6.1. matchpropagates handler throws likepromise-option/matchAsyncOption.
Related
Section titled “Related”promise-option— eager operators on a Promise of Option.option— sync operators on plain Option values.