Buckets:
| import { operate } from '../util/lift'; | |
| import { createOperatorSubscriber } from './OperatorSubscriber'; | |
| import { noop } from '../util/noop'; | |
| import { innerFrom } from '../observable/innerFrom'; | |
| export function distinct(keySelector, flushes) { | |
| return operate((source, subscriber) => { | |
| const distinctKeys = new Set(); | |
| source.subscribe(createOperatorSubscriber(subscriber, (value) => { | |
| const key = keySelector ? keySelector(value) : value; | |
| if (!distinctKeys.has(key)) { | |
| distinctKeys.add(key); | |
| subscriber.next(value); | |
| } | |
| })); | |
| flushes && innerFrom(flushes).subscribe(createOperatorSubscriber(subscriber, () => distinctKeys.clear(), noop)); | |
| }); | |
| } | |
| //# sourceMappingURL=distinct.js.map |
Xet Storage Details
- Size:
- 785 Bytes
- Xet hash:
- 9fd1a08c6e53ff64e76f13852a9d5d5c8bbddfe9d550a88f6e9d50877afd3e7c
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.