Skip to content

Commit f7e34eb

Browse files
Simple Javadoc for Bind
… ready to be re-written by @DavidMGross :-)
1 parent fcefa21 commit f7e34eb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

rxjava-core/src/main/java/rx/Observable.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,18 @@ public void call(Operator<? super T> o) {
252252
});
253253
}
254254

255+
/**
256+
* Bind a function to the current Observable and return a new Observable that when subscribed to will pass the values of the current Observable through the function.
257+
* <p>
258+
* In other words, this allows chaining operators together on an Observable for acting on the values within the Observable.
259+
* <p>
260+
* {@code
261+
* observable.map(...).filter(...).take(5).bind(new OperatorA()).bind(new OperatorB(...)).subscribe()
262+
* }
263+
*
264+
* @param bind
265+
* @return an Observable that emits values that are the result of applying the bind function to the values of the current Observable
266+
*/
255267
public <R> Observable<R> bind(final Func1<Operator<? super R>, Operator<? super T>> bind) {
256268
return new Observable<R>(new Action1<Operator<? super R>>() {
257269

0 commit comments

Comments
 (0)