- Hands-On Reactive Programming in Spring 5
- Oleh Dokuka Igor Lozynskyi
- 77字
- 2021-07-23 16:36:23
Rebuilding our application with RxJava
To get a feel for RxJava, let's rewrite the previously written temperature sensing application with RxJava. To use the library in the application, let's add the following dependency to the build.gradle file:
compile('io.reactivex:rxjava:1.3.8')
Here, we are using the same value class to represent the current temperature, as shown in the following code:
final class Temperature {
private final double value;
// constructor & getter
}