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
| Parameter | Type | Description |
|---|---|---|
predicate? | (value, index) => value is S | A 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
| Parameter | Type | Description |
|---|---|---|
predicate? | (value, index) => boolean | A 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
| Parameter | Type | Description |
|---|---|---|
predicate? | BooleanConstructor | A 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>>