Closed anthonyjoeseph closed 3 years ago
@anthonyjoeseph what about a simpler signature?
/**
* @category constructors
* @since 0.6.12
*/
export const tryCatch: <A>(a: Observable<A>) => ObservableEither<unknown, A> =
/*#__PURE__*/
flow(R.map(E.right), catchError(flow(E.left, R.of)))
I love that signature! Updated
@anthonyjoeseph thanks. This branch has conflicts, maybe you have an old docs-ts
version locally.
Ah thanks for the tip! I wasn't sure why that kept happening. Updated
It looks like this version of tryCatch
doesn't accept a function to handle/convert the error, unlike all other implementations of tryCatch
such as TaskEither.tryCatch
. Are we planning to make all other implementations match this one, or should we make this one consistent with the rest?
Are we planning to make all other implementations match this one
yes
Closes #31
Related: gcanti/fp-ts#1376
Version of https://github.com/gcanti/fp-ts-rxjs/pull/46, branched from 0.6.12