Skip to content

Commit bb7944e

Browse files
committed
Update README.md
1 parent edfbbbd commit bb7944e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ fun <T> Observable<T>.observeOnFx() = this.observeOn(JavaFxScheduler.getInstance
147147
This allows you to better use Kotlin's features to interop JavaFX and RxJava much more cleanly.
148148

149149
```kotlin
150-
val sourceObservable = Observable.just("Alpha","Beta","Gamma")
151-
val lengthBinding = sourceObservable.map { it.length }.toBinding()
150+
val textField = TextField()
151+
val textInputs = textField.toObservable()
152+
val lengthBinding = textInputs.map { it.length }.toBinding()
152153
```
153154

154155
If you are doing JavaFX and Kotlin development, definitely check out [TornadoFX](https://github.com/edvin/tornadofx) as well to utilize type-safe builders and other features enabled by Kotlin.

0 commit comments

Comments
 (0)