map

1 input stream project function

  • When the input stream emits a value, it is given to the project function and the resulting value is emitted

returns a new stream of projected values

filter

1 input stream predicate function

  • When the input stream emits a value, it is given to the predicate
    • If the predicate returns ✔ true, the value is emitted
    • Otherwise, the value is ignored

returns a new stream of filtered values

Project vs Predicate

In this example, ▬ isEven accepts a number as an argument, then:

  • If it is an even number, it returns ✔ true
  • Otherwise, it returns ✘ false

It is used as:

  • a project function on ❚ map
  • a predicate function on ❚ filter

A predicate returns ✔ true or ✘ false.

Next


merge vs combineLatest

See also


project vs predicate

💌 Learn Reactive Programming and stay tuned

Occasional updates, plus:

News

@CedricSoulas