How to use the distinctUntilChanged function from rxjs

Find comprehensive JavaScript rxjs.distinctUntilChanged code examples handpicked from public code repositorys.

48
49
50
51
52
53
54
55
56
    switchMap(({state, error_message: error}) =>
        (error || state === FAILED)
            ? throwError(() => new Error(error))
            : of(state)
    ),
    distinctUntilChanged(),
    takeWhile(state => isRunning(state)),
    map(toProgress)
)
fork icon45
star icon178
watch icon34

54
55
56
57
58
59
60
61
62
63
    defaultMessage: 'Completed!',
    messageKey: 'tasks.status.completed'
}

const progressState$ = task.submit$(id, params).pipe(
    distinctUntilChanged((p1, p2) => _.isEqual(
        _.pick(p1, ['defaultMessage', 'messageKey', 'messageArgs']),
        _.pick(p2, ['defaultMessage', 'messageKey', 'messageArgs'])
    )),
    map(progress => {
fork icon45
star icon178
watch icon34

57
58
59
60
61
62
63
64
65
66
trigger$.pipe(
    switchMap(trigger =>
        concat(triggerAction$(trigger), poll$)
    ),
    exhaustMap(() => from(scanDirs())),
    distinctUntilChanged(_.isEqual),
    takeUntil(stop$),
    catchError(error => {
        log.error(error)
    })
fork icon45
star icon177
watch icon0