Skip to content

Commit c2f7ae1

Browse files
committed
docs: tldr the readme
1 parent cdeb6db commit c2f7ae1

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Distinct Until Changed Immutable
22

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+
___
322
Returns an Observable that emits all items emitted by the source Observable that are deeply distinct by comparison from the previous item.
423

524
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
2140
An example using a compare function
2241
```javascript
2342
import { of } from 'rxjs';
24-
import { distinctUntilChangedImmutable } from 'rxjs/operators';
43+
import { distinctUntilChangedImmutable } from 'distinct-until-changed-immutable';
2544

2645
interface Person {
2746
age: number,

0 commit comments

Comments
 (0)