fork-join-deep
v1.2.0
Published
<div align="center"> <h1>fork-join-deep</h1> <p>Like RxJS <a href="https://rxjs-dev.firebaseapp.com/api/index/function/forkJoin">forkJoin</a> operator, but deep traversal of the source.</p> </div>
Downloads
7
Readme
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