Skip to content

Commit

Permalink
Clarify the documentation for scan operators (#7093)
Browse files Browse the repository at this point in the history
* Clarify the documentation for scan operators

* Fix typo

Co-authored-by: David Andrews <dta@duolingo.com>
  • Loading branch information
akarnokd and DavidDTA committed Oct 6, 2020
1 parent 35702ec commit 82a218a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
21 changes: 9 additions & 12 deletions src/main/java/io/reactivex/rxjava3/core/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -14675,10 +14675,9 @@ public final <U> Flowable<T> sample(@NonNull Publisher<U> sampler, boolean emitL
}

/**
* Returns a {@code Flowable} that applies a specified accumulator function to the first item emitted by the current
* {@code Flowable}, then feeds the result of that function along with the second item emitted by the current
* {@code Floawble} into the same function, and so on until all items have been emitted by the current {@code Flowable},
* emitting the result of each of these iterations.
* Returns a {@code Flowable} that emits the first value emitted by the current {@code Flowable}, then emits one value
* for each subsequent value emitted by the current {@code Flowable}. Each emission after the first is the result of
* applying the specified accumulator function to the previous emission and the corresponding value from the current @{code Flowable}.
* <p>
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/scan.v3.png" alt="">
* <p>
Expand Down Expand Up @@ -14709,10 +14708,9 @@ public final Flowable<T> scan(@NonNull BiFunction<T, T, T> accumulator) {
}

/**
* Returns a {@code Flowable} that applies a specified accumulator function to the first item emitted by the current
* {@code Flowable} and a seed value, then feeds the result of that function along with the second item emitted by
* the current {@code Flowable} into the same function, and so on until all items have been emitted by the current
* {@code Flowable}, emitting the result of each of these iterations.
* Returns a {@code Flowable} that emits the provided initial (seed) value, then emits one value for each value emitted
* by the current {@code Flowable}. Each emission after the first is the result of applying the specified accumulator
* function to the previous emission and the corresponding value from the current @{code Flowable}.
* <p>
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/scanSeed.v3.png" alt="">
* <p>
Expand Down Expand Up @@ -14763,10 +14761,9 @@ public final Flowable<T> scan(@NonNull BiFunction<T, T, T> accumulator) {
}

/**
* Returns a {@code Flowable} that applies a specified accumulator function to the first item emitted by the current
* {@code Flowable} and a seed value, then feeds the result of that function along with the second item emitted by
* the current {@code Flowable} into the same function, and so on until all items have been emitted by the current
* {@code Flowable}, emitting the result of each of these iterations.
* Returns a {@code Flowable} that emits the provided initial (seed) value, then emits one value for each value emitted
* by the current {@code Flowable}. Each emission after the first is the result of applying the specified accumulator
* function to the previous emission and the corresponding value from the current @{code Flowable}.
* <p>
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/scanSeed.v3.png" alt="">
* <p>
Expand Down
21 changes: 9 additions & 12 deletions src/main/java/io/reactivex/rxjava3/core/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -12202,10 +12202,9 @@ public final <U> Observable<T> sample(@NonNull ObservableSource<U> sampler, bool
}

/**
* Returns an {@code Observable} that applies a specified accumulator function to the first item emitted by the current
* {@code Observable}, then feeds the result of that function along with the second item emitted by the current
* {@code Observable} into the same function, and so on until all items have been emitted by the current {@code Observable},
* emitting the result of each of these iterations.
* Returns an {@code Observable} that emits the first value emitted by the current {@code Observable}, then emits one value
* for each subsequent value emitted by the current {@code Observable}. Each emission after the first is the result of
* applying the specified accumulator function to the previous emission and the corresponding value from the current @{code Observable}.
* <p>
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/scan.v3.png" alt="">
* <p>
Expand All @@ -12232,10 +12231,9 @@ public final Observable<T> scan(@NonNull BiFunction<T, T, T> accumulator) {
}

/**
* Returns an {@code Observable} that applies a specified accumulator function to the first item emitted by the current
* {@code Observable} and a seed value, then feeds the result of that function along with the second item emitted by
* the current {@code Observable} into the same function, and so on until all items have been emitted by the current
* {@code Observable}, emitting the result of each of these iterations.
* Returns an {@code Observable} that emits the provided initial (seed) value, then emits one value for each value emitted
* by the current {@code Observable}. Each emission after the first is the result of applying the specified accumulator
* function to the previous emission and the corresponding value from the current @{code Observable}.
* <p>
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/scanSeed.v3.png" alt="">
* <p>
Expand Down Expand Up @@ -12282,10 +12280,9 @@ public final <R> Observable<R> scan(@NonNull R initialValue, @NonNull BiFunction
}

/**
* Returns an {@code Observable} that applies a specified accumulator function to the first item emitted by the current
* {@code Observable} and a seed value, then feeds the result of that function along with the second item emitted by
* the current {@code Observable} into the same function, and so on until all items have been emitted by the current
* {@code Observable}, emitting the result of each of these iterations.
* Returns an {@code Observable} that emits the provided initial (seed) value, then emits one value for each value emitted
* by the current {@code Observable}. Each emission after the first is the result of applying the specified accumulator
* function to the previous emission and the corresponding value from the current @{code Observable}.
* <p>
* <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/scanSeed.v3.png" alt="">
* <p>
Expand Down

0 comments on commit 82a218a

Please sign in to comment.