@cascateer/core 2.0.22 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascateer/core",
3
- "version": "2.0.22",
3
+ "version": "2.0.24",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cascateer/core.git"
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,10 +78,13 @@ class Memoizable<Args, Result> {
77
78
  }),
78
79
  shareReplay({ bufferSize: 1, refCount: false }),
79
80
  ),
80
- (args) => objectHash(args ?? null),
81
+ resolver,
81
82
  );
82
83
 
83
- return (args) => new TapObservable(effect(args), loading);
84
+ return memoize(
85
+ (args) => new TapObservable(effect(args), loading),
86
+ resolver,
87
+ );
84
88
  };
85
89
 
86
90
  this.share = (invalidatedTags) => (args) =>
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) => (args) => new TapObservable(effect(args), deps),
103
+ (effect) =>
104
+ memoize(
105
+ (args) => new TapObservable(effect(args), deps),
106
+ (args) => objectHash(args ?? null),
107
+ ),
103
108
  );
104
109
  },
105
110
  }),