Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Observable, of } from 'rxjs';
import { toArray } from 'rxjs/operators';
import { withFilterMap } from './with-filter-map.operator';
import { skipOnCondition } from './skip-on-condition.operator';

describe('with-filter-map.operator.ts', () => {
describe('skip-on-condition.operator.ts', () => {
it('should filter values correctly when predicate returns true', (done: jest.DoneCallback) => {
const source$: Observable<string> = of('a', 'b', 'c');
const other$: Observable<boolean> = of(true);
Expand All @@ -11,7 +11,7 @@ describe('with-filter-map.operator.ts', () => {

source$
.pipe(
withFilterMap(other$, (value: boolean) => value),
skipOnCondition(other$, (value: boolean) => value),
toArray()
)
.subscribe({
Expand All @@ -28,7 +28,7 @@ describe('with-filter-map.operator.ts', () => {

source$
.pipe(
withFilterMap(other$, (value: boolean) => value),
skipOnCondition(other$, (value: boolean) => value),
toArray()
)
.subscribe({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { filter, map, withLatestFrom } from 'rxjs/operators';
* The source value is emitted only if the predicate returns true.
* @returns An operator function that returns an observable emitting the source values that pass the predicate check.
*/
export function withFilterMap<T, O>(
export function skipOnCondition<T, O>(
other$: Observable<O>,
predicate: (otherValue: O) => boolean
): OperatorFunction<T, T> {
Expand Down