How to use the ix/asynciterable.throwError function in ix

To help you get started, we’ve selected a few ix examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ReactiveX / IxJS / spec / asynciterable / catch-spec.ts View on Github external
test('AsyncIterable#catch with concat error', async () => {
  const res = catchError(concat(range(0, 5), throwError(new Error())), range(5, 5));

  expect(await sequenceEqual(res, range(0, 10))).toBeTruthy();
});
github ReactiveX / IxJS / spec / asynciterable / catch-spec.ts View on Github external
test('AsyncIterable#catch still throws', async () => {
  const e1 = new Error();
  const er1 = throwError(e1);

  const e2 = new Error();
  const er2 = throwError(e2);

  const e3 = new Error();
  const er3 = throwError(e3);

  const res = catchError(concat(range(0, 2), er1), concat(range(2, 2), er2), er3);

  const it = res[Symbol.asyncIterator]();
  await hasNext(it, 0);
  await hasNext(it, 1);
  await hasNext(it, 2);
  await hasNext(it, 3);
  try {
    await it.next();
github ReactiveX / IxJS / spec / asynciterable / catch-spec.ts View on Github external
test('AsyncIterable#catch still throws', async () => {
  const e1 = new Error();
  const er1 = throwError(e1);

  const e2 = new Error();
  const er2 = throwError(e2);

  const e3 = new Error();
  const er3 = throwError(e3);

  const res = catchError(concat(range(0, 2), er1), concat(range(2, 2), er2), er3);

  const it = res[Symbol.asyncIterator]();
  await hasNext(it, 0);
  await hasNext(it, 1);
  await hasNext(it, 2);
  await hasNext(it, 3);
  try {
    await it.next();
  } catch (e) {
    expect(e != null).toBeTruthy();
  }
github ReactiveX / IxJS / spec / asynciterable / catch-spec.ts View on Github external
test('AsyncIterable#catch still throws', async () => {
  const e1 = new Error();
  const er1 = throwError(e1);

  const e2 = new Error();
  const er2 = throwError(e2);

  const e3 = new Error();
  const er3 = throwError(e3);

  const res = catchError(concat(range(0, 2), er1), concat(range(2, 2), er2), er3);

  const it = res[Symbol.asyncIterator]();
  await hasNext(it, 0);
  await hasNext(it, 1);
  await hasNext(it, 2);
  await hasNext(it, 3);
  try {
    await it.next();
  } catch (e) {
    expect(e != null).toBeTruthy();
  }
});