Returns a Stream that yields elements from the source that are distinct from the previous element based on the key.
Type of items in the source.
Key to compare elements.
Optional
Function to compare elements.
const result = distinctUntilKeyChanged('a')([{ a: 1 }, { a: 1 }, { a: 2 }, { a: 2 }, { a: 3 }, { a: 3 }]);console.log([...result]); // [{ a: 1 }, { a: 2 }, { a: 3 }] Copy
const result = distinctUntilKeyChanged('a')([{ a: 1 }, { a: 1 }, { a: 2 }, { a: 2 }, { a: 3 }, { a: 3 }]);console.log([...result]); // [{ a: 1 }, { a: 2 }, { a: 3 }]
Returns a Stream that yields elements from the source that are distinct from the previous element based on the key.