Skip to content

Commit 6494b7d

Browse files
committed
Linked to examples
1 parent 0702d8f commit 6494b7d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Part 3 - Taming the sequence/7. Custom operators.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ public class RunningAverage implements Observable.Transformer<Integer, Double> {
173173

174174
We just added the parameter as a field in the operator, added constructors for the uses that we cover and used the parameter in our Rx operations. Now we can do `source.compose(new RunningAverage(5))`, where, ideally, we would be calling `source.runningAverage(5)`. Java only lets us go this far. Rx is a functional paradigm, but Java is still primarily an object oriented language and quite conservative at that.
175175

176+
You can a complete example of for this example operator [here](/tests/java/itrx/chapter3/custom/ComposeExample.java).
177+
176178
### lift
177179

178180
Internally, every Rx operator does 3 things
@@ -239,7 +241,7 @@ Observable.range(0, 5)
239241
.lift(new MyMap<Integer, String>(i -> i + "!"))
240242
.subscribe(System.out::println);
241243
```
242-
Output
244+
[Output](/tests/java/itrx/chapter3/custom/LiftExample.java)
243245
```
244246
0!
245247
1!
@@ -289,7 +291,7 @@ source.doOnUnsubscribe(() -> System.out.println("Unsubscribed"))
289291
System.out::println,
290292
() -> System.out.println("Completed"));
291293
```
292-
Output
294+
[Output](/tests/java/itrx/chapter3/custom/SerializeExample.java)
293295
```
294296
1
295297
2
@@ -326,7 +328,7 @@ source.doOnUnsubscribe(() -> System.out.println("Unsubscribed"))
326328
}
327329
});
328330
```
329-
Output
331+
[Output](/tests/java/itrx/chapter3/custom/SerializeExample.java)
330332
```
331333
1
332334
2
@@ -369,7 +371,7 @@ source.doOnUnsubscribe(() -> System.out.println("Unsubscribed"))
369371
}
370372
});
371373
```
372-
Output
374+
[Output](/tests/java/itrx/chapter3/custom/SerializeExample.java)
373375
```
374376
1
375377
2

0 commit comments

Comments
 (0)