/** * Like fork but handles an error with the provided handler. * * @tsplus static effect/core/io/Effect.Aspects forkWithErrorHandler * @tsplus pipeable effect/core/io/Effect forkWithErrorHandler */ export function forkWithErrorHandler(handler: (e: E) => Effect) { return (self: Effect): Effect> => self .onError((cause) => cause.failureOrCause.fold(handler, Effect.failCause)) .fork }