fork-join-deep
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

fork-join-deep

Like RxJS forkJoin operator, but deep traversal of the source.


Build Status codecov npm npm MIT license PRs Welcome

Installation

npm i --save fork-join-deep

Feature

1. Support primitive values. (codesandbox)

forkJoin

forkJoin({
  a: 0,
}).subscribe((result) => {
  console.log(result);
  // ↓↓↓ output ↓↓↓
  // Error: You provided '0' where a stream was expected.
  // You can provide an Observable, Promise, Array, or Iterable.
});

forkJoinDeep

forkJoinDeep({
  a: 0,
}).subscribe((result) => {
  console.log(result);
  // ↓↓↓ output ↓↓↓
  // {a: 0}
});

2. Support nested objects. (codesandbox)

forkJoin

forkJoin({
  a: {
    a1: of(0),
  },
}).subscribe((result) => {
  console.log(result);
  // ↓↓↓ output ↓↓↓
  // Error: You provided '0' where a stream was expected.
  // You can provide an Observable, Promise, Array, or Iterable.
});

forkJoinDeep

forkJoinDeep({
  a: {
    a1: of(0),
  },
}).subscribe((result) => {
  console.log(result);
  // ↓↓↓ output ↓↓↓
  // {a: a1: {0}}
});

3. Support Higher-order Observables. (codesandbox)

forkJoin

forkJoin({
  a: of(of(0)),
}).subscribe((result) => {
  console.log(result);
  // ↓↓↓ output ↓↓↓
  // {a: Observable}
});

forkJoinDeep

forkJoinDeep({
  a: of(of(0)),
}).subscribe((result) => {
  console.log(result);
  // ↓↓↓ output ↓↓↓
  // {a: 0}
});

LICENSE

MIT

Readme

Keywords

Package Sidebar

Install

npm i fork-join-deep

Weekly Downloads

8

Version

1.2.0

License

MIT

Unpacked Size

35.9 kB

Total Files

24

Last publish

Collaborators

  • ystarlongzi