Skip to content

bindTo

bindTo<K>(key): <E, A>(data) => Result<E, { [P in string]: A }>

Defined in: Core/Result.ts:316

Converts a Result value into an object containing a single property. Initiates the pipeline accumulator record.

K extends string

K

<E, A>(data) => Result<E, { [P in string]: A }>

pipe(Result.ok(42), Result.bindTo("value")); // Ok({ value: 42 })