How to use the ix/iterable.sequenceEqual 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 / combinelatest-spec.ts View on Github external
const zs = of(7, 8, 9);

  const res = combineLatest(xs, ys, zs);
  const it = res[Symbol.asyncIterator]();

  let next = await it.next();
  expect(next.done).toBeFalsy();
  expect(sequenceEqual(next.value, [3, 6, 7])).toBeTruthy();

  next = await it.next();
  expect(next.done).toBeFalsy();
  expect(sequenceEqual(next.value, [3, 6, 8])).toBeTruthy();

  next = await it.next();
  expect(next.done).toBeFalsy();
  expect(sequenceEqual(next.value, [3, 6, 9])).toBeTruthy();

  next = await it.next();
  expect(next.done).toBeTruthy();
});
github ReactiveX / IxJS / spec / iterable-operators / concatall-spec.ts View on Github external
test('Iterable#concat concatAll order of effects', () => {
  let i = 0;
  const xss = range(0, 3).pipe(
    map(x => range(0, x + 1)),
    tap({ next: async () => ++i })
  );
  const res = xss.pipe(
    concatAll(),
    map(x => i + ' - ' + x)
  );

  expect(sequenceEqual(res, of('1 - 0', '2 - 0', '2 - 1', '3 - 0', '3 - 1', '3 - 2'))).toBeTruthy();
});
github ReactiveX / IxJS / spec / iterable / concat-spec.ts View on Github external
test('Iterable#concat behavior', () => {
  const res = concat([1, 2, 3], [4, 5]);
  expect(sequenceEqual(res, of(1, 2, 3, 4, 5))).toBeTruthy();
});
github ReactiveX / IxJS / spec / asynciterable / forkjoin-spec.ts View on Github external
test('AsyncIterable#forkJoin no selector last smaller', async () => {
  const xs = of(42, 25, 39);
  const ys = of(25, 39, 42);
  const zs = of(39, 42);

  const res = await forkJoin(xs, ys, zs);
  expect(sequenceEqual(res as number[], [39, 42, 42])).toBeTruthy();
});
github ReactiveX / IxJS / spec / asynciterable / asyncify-spec.ts View on Github external
test('AsyncIterable#asyncify multiple arguments', async () => {
  const callbackFn = (a: number, b: number, cb: Function) => {
    cb(a, b);
  };

  const asyncFn = asyncify(callbackFn);
  const xs = asyncFn(1, 2);

  const it = xs[Symbol.asyncIterator]();
  const { value, done } = await it.next();
  expect(sequenceEqual(value as number[], [1, 2])).toBeTruthy();
  expect(done).toBeFalsy();
  await noNext(it);
});
github ReactiveX / IxJS / spec / iterable-operators / catcherror-spec.ts View on Github external
test('Iterable#catchError source and handler types are composed', () => {
  const xs = range(0, 10);
  const res = xs.pipe(catchError((_: Error) => of('foo')));
  expect(sequenceEqual(res, xs)).toBeTruthy();
});
github ReactiveX / IxJS / spec / iterable / catcherror-spec.ts View on Github external
test('Iterable#catchWith no error misses', () => {
  const xs = range(0, 10);
  const res = xs.pipe(catchError(_ => of(42)));
  expect(sequenceEqual(res, xs)).toBeTruthy();
});