How to use the ix/iterable.of 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 / iterable / 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 / iterable / inference-spec.ts View on Github external
test(`#pipeThrough type inference is correct with writable stream`, () => {
      const source = of(0, 1, 2).pipeThrough(new TransformStream());
      expect(source).toEqualStream([0, 1, 2]);
    });
    test(`#pipeThrough type inference is correct with writable stream and pipe options`, () => {
github ReactiveX / IxJS / spec / iterable / inference-spec.ts View on Github external
test(`#pipe type inference is correct with writable stream and pipe options`, () => {
      const source = of(0, 1, 2).pipe(
        new PassThrough({ objectMode: true }),
        { end: true }
      );
      expect(source).toEqualStream([0, 1, 2]);
    });
  }
github ReactiveX / IxJS / spec / iterable-operators / concatall-spec.ts View on Github external
test('Iterable#concat concatAll behavior', () => {
  const res = of(of(1, 2, 3), of(4, 5)).pipe(concatAll());
  expect(sequenceEqual(res, of(1, 2, 3, 4, 5))).toBeTruthy();
});
github ReactiveX / IxJS / spec / iterable-operators / concatall-spec.ts View on Github external
test('Iterable#concat concatAll behavior', () => {
  const res = of(of(1, 2, 3), of(4, 5)).pipe(concatAll());
  expect(sequenceEqual(res, of(1, 2, 3, 4, 5))).toBeTruthy();
});
github ReactiveX / IxJS / spec / iterable-operators / catcherror-spec.ts View on Github external
  const res = xs.pipe(catchError((_: Error) => of('foo')));
  expect(sequenceEqual(res, xs)).toBeTruthy();
github ReactiveX / IxJS / spec / iterable-operators / catcherror-spec.ts View on Github external
  const res = xs.pipe(catchError((_: Error) => of(42)));
  expect(sequenceEqual(res, xs)).toBeTruthy();
github ReactiveX / IxJS / spec / iterable / catcherror-spec.ts View on Github external
  const res = xs.pipe(catchError(_ => of(42)));
  expect(sequenceEqual(res, xs)).toBeTruthy();