import { type KeepInitialValueOperator } from '../types/index.mjs'; /** * Skips emissions if the value hasn't changed from the previous emission. * Uses a custom equality function or Object.is by default. * * @template A - The type of values from the source * @param eq - Equality comparison function (default: Object.is) * @returns An operator that skips duplicate consecutive values * * @example * ```ts * // Timeline: * // * // num$ 1 1 2 2 1 2 3 2 * // distinct$ 1 2 1 2 3 2 * // * // Explanation: * // - skipIfNoChange filters out consecutive duplicate values * // - Uses strict equality (===) for comparison * // - Only emits when the value actually changes * * const num$ = source(); * * const distinct$ = num$.pipe(skipIfNoChange()); * * const valueHistory: number[] = []; * * distinct$.subscribe((x) => { * valueHistory.push(x); * }); * * num$.next(1); // logs: 1 * * assert.deepStrictEqual(valueHistory, [1]); * * num$.next(1); // nothing logged * * assert.deepStrictEqual(valueHistory, [1]); * * num$.next(2); // logs: 2 * * assert.deepStrictEqual(valueHistory, [1, 2]); * * num$.next(2); // nothing logged * * num$.next(1); // logs: 1 * * assert.deepStrictEqual(valueHistory, [1, 2, 1]); * * num$.next(2); // logs: 2 * * assert.deepStrictEqual(valueHistory, [1, 2, 1, 2]); * * num$.next(3); // logs: 3 * * assert.deepStrictEqual(valueHistory, [1, 2, 1, 2, 3]); * * num$.next(2); // logs: 2 * * assert.deepStrictEqual(valueHistory, [1, 2, 1, 2, 3, 2]); * ``` */ export declare const skipIfNoChange: (eq?: (x: A, y: A) => boolean) => KeepInitialValueOperator; /** * Alias for `skipIfNoChange`. * @see skipIfNoChange */ export declare const distinctUntilChanged: (eq?: (x: A, y: A) => boolean) => KeepInitialValueOperator; //# sourceMappingURL=skip-if-no-change.d.mts.map