File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Distinct Until Changed Immutable
2
2
3
+ ### tl;dr
4
+
5
+ Install:
6
+
7
+ ` npm i -S distinct-until-changed-immutable `
8
+
9
+ then import:
10
+
11
+ ` import { distinctUntilChangedImmutable } from 'distinct-until-changed-immutable'; `
12
+
13
+ then use:
14
+
15
+ ``` javascript
16
+ of ({a: ' a' }, {b: ' b' }, {b: ' b' })
17
+ .pipe (
18
+ distinctUntilChangedImmutable (),
19
+ )
20
+ ```
21
+ ___
3
22
Returns an Observable that emits all items emitted by the source Observable that are deeply distinct by comparison from the previous item.
4
23
5
24
If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted.
@@ -21,7 +40,7 @@ Returns an Observable that emits all items emitted by the source Observable that
21
40
An example using a compare function
22
41
``` javascript
23
42
import { of } from ' rxjs' ;
24
- import { distinctUntilChangedImmutable } from ' rxjs/operators ' ;
43
+ import { distinctUntilChangedImmutable } from ' distinct-until-changed-immutable ' ;
25
44
26
45
interface Person {
27
46
age: number,
You can’t perform that action at this time.
0 commit comments