UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

11 lines (10 loc) 917 B
import { AsyncIterableX } from '../asynciterable'; /** * Filters a sequence of values based on a predicate. * @param {Iterable<T | Promise<T>> | AsyncIterable<T>} source Source sequence. * @param {function(value: T, index: number): boolean | Promise<boolean>} predicate A function to test each source element for a condition. * @param {Object} [thisArg] Value to use as this when executing callback. * @return {AsyncIterable<T>} Sequence that contains elements from the input sequence that satisfy the condition. */ export declare function filterAsync<T, S extends T>(source: Iterable<T | PromiseLike<T>> | AsyncIterable<T>, predicate: (value: T, index: number) => value is S, thisArg?: any): AsyncIterableX<S>; export declare function filterAsync<T>(source: Iterable<T | PromiseLike<T>> | AsyncIterable<T>, predicate: (value: T, index: number) => boolean | Promise<boolean>, thisArg?: any): AsyncIterableX<T>;