Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update outdated java example in wiki #6331 #6351

Merged
merged 3 commits into from
Dec 28, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 2 additions & 9 deletions docs/How-To-Use-RxJava.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@ You can find additional code examples in the `/src/examples` folders of each [la

```java
public static void hello(String... names) {
Observable.from(names).subscribe(new Action1<String>() {

@Override
public void call(String s) {
System.out.println("Hello " + s + "!");
}

});
Observable.fromArray(names).subscribe(s -> System.out.println("Hello " + s));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd instead show a Consumer<String> and the lambda version, similar to the hello world example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated similar to hello world example.

}
```

Expand Down Expand Up @@ -397,4 +390,4 @@ myModifiedObservable = myObservable.onErrorResumeNext({ t ->
Throwable myThrowable = myCustomizedThrowableCreator(t);
return (Observable.error(myThrowable));
});
```
```