@cascateer/core 2.1.43 → 2.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/types.ts +19 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascateer/core",
3
- "version": "2.1.43",
3
+ "version": "2.1.44",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cascateer/core.git"
package/src/types.ts CHANGED
@@ -1,10 +1,16 @@
1
1
  import { Dictionary, mapValues, tap } from "lodash";
2
- import { combineLatest, of, ReplaySubject, UnaryFunction } from "rxjs";
2
+ import {
3
+ combineLatest,
4
+ ReplaySubject,
5
+ tap as rxjsTap,
6
+ switchMap,
7
+ UnaryFunction,
8
+ } from "rxjs";
3
9
  import { Observable } from "rxjs/internal/Observable";
4
10
  import { ObservableInput } from "rxjs/internal/types";
5
11
  import { memoizeHashed } from "./lib/memoizeHashed";
6
12
  import { ProxyObservable } from "./observable";
7
- import { every } from "./operators";
13
+ import { concat, every, some } from "./operators";
8
14
 
9
15
  export interface Effect<Args, Result> extends UnaryFunction<
10
16
  Args,
@@ -48,7 +54,17 @@ export class ProxyEffectInterceptor extends ReplaySubject<
48
54
  }
49
55
 
50
56
  proxy<Args, Result>(effect: Effect<Args, Result>): ProxyEffect<Args, Result> {
51
- return (args) => new ProxyObservable(effect(args), () => of(false));
57
+ return (args) =>
58
+ new ProxyObservable(effect(args), () =>
59
+ this.pipe(
60
+ concat(),
61
+ rxjsTap((x) => console.log(x)),
62
+ switchMap((sources) =>
63
+ combineLatest(sources.map((source) => source.pending)),
64
+ ),
65
+ some(),
66
+ ),
67
+ );
52
68
  }
53
69
  }
54
70