WIP
const { interval, of, throwError } = Rx;
const { catchError, concat, endWith, switchMap, take } = RxOperators;
interval(1000)
.pipe(
take(4),
switchMap(value => (
value === 2
? (
throwError('error')
.pipe(
catchError(() => of('caughtError')),
)
)
: of(value)
)),
concat(of('concatted')),
endWith('hi'),
)
const { interval, of, throwError } = Rx;
const { catchError, concat, endWith, ignoreElements, switchMap, take } = RxOperators;
interval(1000)
.pipe(
take(4),
switchMap(value => (
value === 2
? (
throwError('error')
.pipe(
catchError(() => of('caughtError')),
ignoreElements(),
)
)
: of(value)
)),
concat(of('concatted')),
endWith('hi'),
)