Skip to content

Documentation / @eventkit/base / filter

Function: filter()

Call Signature

ts
function filter<T, S>(predicate?): OperatorFunction<T, S>

Filters items emitted by the source observable by only emitting those that satisfy a specified predicate.

Type Parameters

Type Parameter
T
S

Parameters

ParameterTypeDescription
predicate?(value, index) => value is SA function that evaluates each value emitted by the source Observable. Returns true to keep the value, false to drop it.

Returns

OperatorFunction<T, S>

Call Signature

ts
function filter<T>(predicate?): OperatorFunction<T, T>

Filters items emitted by the source observable by only emitting those that satisfy a specified predicate.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
predicate?(value, index) => booleanA function that evaluates each value emitted by the source Observable. Returns true to keep the value, false to drop it.

Returns

OperatorFunction<T, T>

Call Signature

ts
function filter<T>(predicate?): OperatorFunction<T, TruthyTypesOf<T>>

Filters items emitted by the source observable by only emitting those that satisfy a specified predicate.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
predicate?BooleanConstructorA function that evaluates each value emitted by the source Observable. Returns true to keep the value, false to drop it.

Returns

OperatorFunction<T, TruthyTypesOf<T>>

Released under the MIT License.