@cascateer/core 2.0.23 → 2.0.24
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.
- package/package.json +1 -1
- package/src/api.ts +3 -2
- package/src/terminal.ts +7 -2
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -57,6 +57,7 @@ class Memoizable<Args, Result> {
|
|
|
57
57
|
this.subscribe = (invalidatedTags) => {
|
|
58
58
|
const loading = new BehaviorSubject(false);
|
|
59
59
|
|
|
60
|
+
const resolver = (args: Args) => objectHash(args ?? null);
|
|
60
61
|
const effect: Effect<Args, Result> = memoize(
|
|
61
62
|
(args) =>
|
|
62
63
|
this.predicate(args).pipe(
|
|
@@ -77,12 +78,12 @@ class Memoizable<Args, Result> {
|
|
|
77
78
|
}),
|
|
78
79
|
shareReplay({ bufferSize: 1, refCount: false }),
|
|
79
80
|
),
|
|
80
|
-
|
|
81
|
+
resolver,
|
|
81
82
|
);
|
|
82
83
|
|
|
83
84
|
return memoize(
|
|
84
85
|
(args) => new TapObservable(effect(args), loading),
|
|
85
|
-
|
|
86
|
+
resolver,
|
|
86
87
|
);
|
|
87
88
|
};
|
|
88
89
|
|
package/src/terminal.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Dictionary, thru } from "lodash";
|
|
1
|
+
import { Dictionary, memoize, thru } from "lodash";
|
|
2
|
+
import objectHash from "object-hash";
|
|
2
3
|
import { combineLatest, distinct, map, switchMap, UnaryFunction } from "rxjs";
|
|
3
4
|
import { ApiAdapter, ApiEffect } from "./api";
|
|
4
5
|
import { ExtendableDictionary } from "./lib";
|
|
@@ -99,7 +100,11 @@ export class ExtendableTerminalAdapter<
|
|
|
99
100
|
effects: asTapEffects(currentEffects, deps),
|
|
100
101
|
},
|
|
101
102
|
}),
|
|
102
|
-
(effect) =>
|
|
103
|
+
(effect) =>
|
|
104
|
+
memoize(
|
|
105
|
+
(args) => new TapObservable(effect(args), deps),
|
|
106
|
+
(args) => objectHash(args ?? null),
|
|
107
|
+
),
|
|
103
108
|
);
|
|
104
109
|
},
|
|
105
110
|
}),
|