Update drr equality (#1469)

* Update drr equality

* null === null

* Array length compare

* isFunction(next.eq)

* Just JSON.stringify on compare

* Add distinctUntilChanged in  rpc-core

* prev/next -> a/b
This commit is contained in:
Jaco Greeff
2019-10-10 20:41:57 +02:00
committed by GitHub
parent 38529ad13c
commit bf8bed36ef
2 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -22,7 +22,9 @@ export const drr = (): DrrResult => <T> (source$: Observable<T>): Observable<T>
throw error;
}),
distinctUntilChanged(),
distinctUntilChanged((a: any, b: any): boolean =>
JSON.stringify({ value: a }) === JSON.stringify({ value: b })
),
publishReplay(1),
refCount()
);