Step into Swift logo

What is the Reduce Operator in RxSwift?

Reduce Operator

RxSwift: Reduce Operator

.reduce (_:_:)

  • Sequentially applies a function to each element emitted by an Observable.
  • Also known as an “accumulator” / “aggregate” operator.
  • Take the element emitted from an Observable and passes this along as the result of the function until the Observable ends where it then emits the final resulting value.

reduce((x, y) => x-y)


< All Posts