Skip to content

Commit 82a218a

Browse files
akarnokdDavidDTA
andauthored
Clarify the documentation for scan operators (#7093)
* Clarify the documentation for scan operators * Fix typo Co-authored-by: David Andrews <dta@duolingo.com>
1 parent 35702ec commit 82a218a

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

src/main/java/io/reactivex/rxjava3/core/Flowable.java

+9-12
Original file line numberDiff line numberDiff line change
@@ -14675,10 +14675,9 @@ public final <U> Flowable<T> sample(@NonNull Publisher<U> sampler, boolean emitL
1467514675
}
1467614676

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

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

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

src/main/java/io/reactivex/rxjava3/core/Observable.java

+9-12
Original file line numberDiff line numberDiff line change
@@ -12202,10 +12202,9 @@ public final <U> Observable<T> sample(@NonNull ObservableSource<U> sampler, bool
1220212202
}
1220312203

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

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

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

0 commit comments

Comments
 (0)