@cascateer/core 2.0.20 → 2.0.21

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.20",
3
+ "version": "2.0.21",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cascateer/core.git"
package/src/api.ts CHANGED
@@ -56,7 +56,7 @@ class Memoizable<Args, Result> {
56
56
 
57
57
  this.subscribe = (invalidatedTags) => {
58
58
  const loading = new BehaviorSubject(false);
59
- console.log(loading);
59
+
60
60
  const effect: Effect<Args, Result> = memoize(
61
61
  (args) =>
62
62
  this.predicate(args).pipe(
@@ -80,7 +80,10 @@ class Memoizable<Args, Result> {
80
80
  (args) => objectHash(args ?? null),
81
81
  );
82
82
 
83
- return (args) => new TapObservable(effect(args), loading);
83
+ return (args) => (
84
+ console.log(loading),
85
+ new TapObservable(effect(args), loading)
86
+ );
84
87
  };
85
88
 
86
89
  this.share = (invalidatedTags) => (args) =>
@@ -1,4 +1,10 @@
1
- import { BehaviorSubject, combineLatest, map, Observable } from "rxjs";
1
+ import {
2
+ BehaviorSubject,
3
+ combineLatest,
4
+ distinctUntilChanged,
5
+ map,
6
+ Observable,
7
+ } from "rxjs";
2
8
  import { tapSubscription } from "../operators";
3
9
  import { ProxyObservable } from "./ProxyObservable";
4
10
 
@@ -14,6 +20,7 @@ export class TapObservable<T> extends ProxyObservable<T> {
14
20
 
15
21
  this.loading = combineLatest([loading, subscribed]).pipe(
16
22
  map((values) => values.every(Boolean)),
23
+ distinctUntilChanged(),
17
24
  );
18
25
  }
19
26
  }