Commit 8fed510a authored by Paul BOUTES's avatar Paul BOUTES
Browse files

feat: add introduction with observable and side effects operator

parent f7df5e2d
package com.ippon.codingdojo.reactive.part2;
import io.reactivex.Observable;
public class Code6Solution {
public static void main(String[] args) {
final Observable<String> observable = Observable.create(subscriber -> {
subscriber.onNext("Alice");
subscriber.onNext("John");
subscriber.onError(new RuntimeException("BAZINGA"));
subscriber.onComplete();
});
observable
.subscribe(
System.out::println,
e -> System.out.println("Ouuups : " + e.getMessage()),
() -> System.out.println("onComplete()")
);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment