Skip to content

Commit

Permalink
add RxJava/ dev project
Browse files Browse the repository at this point in the history
  • Loading branch information
yennanliu committed Jul 8, 2024
1 parent 389e388 commit b81528b
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dev_projects/RxJava/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# RX Java

## Ref
- https://www.youtube.com/watch?v=7mbjhNCWqvs&list=PLZ3FH0lcV0117kiek3g-qiQDkO4ezy_Ro
30 changes: 30 additions & 0 deletions dev_projects/RxJava/RxJava/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.yen</groupId>
<artifactId>RxJava</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

<dependencies>

<!--
rxjava
https://mvnrepository.com/artifact/io.reactivex/rxjava
-->
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>1.3.8</version>
</dependency>

</dependencies>

</project>
30 changes: 30 additions & 0 deletions dev_projects/RxJava/RxJava/src/main/java/com/yen/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.yen;

import rx.Observable;

public class Main {
public static void main(String[] args) {

System.out.println("Hello world!");

/** part 1
*
* https://youtu.be/7mbjhNCWqvs?si=nuGVikk2eSXVRqUE
*/
Observable<String> observable = Observable.create(emitter -> {
emitter.onNext("click on 1");
emitter.onNext("click on 2");
emitter.onNext("click on 3");
});

observable.subscribe(item -> {
System.out.println(item);
}, throwable -> {
System.out.println(throwable.getMessage());
}, () -> {
System.out.println("op complete !");
});

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.yen.dev;

public class test1 {
public static void main(String[] args) {
System.out.println(123);
}
}

0 comments on commit b81528b

Please sign in to comment.