Skip to main content

tryCatchK()

tryCatchK<A, B, E>(f, onThrow): (...a) => Either<E, B>

Lifts a function to return an Either when called.


Type Parameters​

A: A extends readonly unknown[]​

The argument types.

B: B​

The return type.

E: E​

The error type.


Parameters​

f: (...a) => B​

The function to lift.

onThrow: (error) => E​

Function to transform thrown errors.


Returns​

A lifted function that returns an Either.


Since​

2.0.0