import { MonoTypeOperatorFunction, Observable } from 'rxjs'; import { IChangeSet } from '../IChangeSet'; import { filter } from 'rxjs/operators'; import { MonoTypeChangeSetOperatorFunction } from '../ChangeSetOperatorFunction'; /** * Supresses updates which are empty * @typeparam TObject The type of the object. * @typeparam TKey The type of the key. */ export function notEmpty(): MonoTypeChangeSetOperatorFunction { return function notEmptyOperator(source: Observable>) { return source.pipe(filter(changes => changes.size !== 0)); }; }