How to use the ix/asynciterable/operators.map 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-operators / writable-stream-pipe-spec.ts View on Github external
test('AsyncIterable#pipe writable-stream single element', async () => {
    const source = of({ name: 'Frank', custId: 98088 });
    const expected = of('Frank');

    expect(
      await sequenceEqual(expected, source.pipe(through()).pipe(map(x => x.name)))
    ).toBeTruthy();
  });
github ReactiveX / IxJS / spec / asynciterable / inference-spec.ts View on Github external
test(`#pipe type inference is correct with two operators`, () => {
    const source = of(0, 1, 2).pipe(
      map(x => x + 1),
      map(x => x + 1)
    );
    expect(source).toEqualStream([2, 3, 4]);
  });
github ReactiveX / IxJS / spec / asynciterable-operators / concatall-spec.ts View on Github external
test('AsyncIterable#concat concatAll order of effects', async () => {
  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(
    await sequenceEqual(res, of('1 - 0', '2 - 0', '2 - 1', '3 - 0', '3 - 1', '3 - 2'))
  ).toBeTruthy();
});
github ReactiveX / IxJS / spec / asynciterable / inference-spec.ts View on Github external
test(`#pipe type inference is correct with two operators`, () => {
    const source = of(0, 1, 2).pipe(
      map(x => x + 1),
      map(x => x + 1)
    );
    expect(source).toEqualStream([2, 3, 4]);
  });
github ReactiveX / IxJS / spec / asynciterable-operators / concatall-spec.ts View on Github external
    map(x => range(0, x + 1)),
    tap({ next: async () => ++i })