MutinyFX
This library offers Mutiny bindings for JavaFX.
Source code can be found here.
Binaries:
<dependency>
<groupId>com.mulgish</groupId>
<artifactId>mutinyfx</artifactId>
<version>1.0.0</version>
</dependency>
Usage:
FxMulti.createFrom().observableValue(observableValue);
FxMulti.createFrom().observableList(observableList);
FxMulti.createFrom().observableSet(observableSet);
FxMulti.createFrom().observableMap(observableMap);
Examples:
Observing list additions
FxMulti.createFrom().observableList(observableList)
.filter(ListChangeListener.Change::wasAdded)
.subscribe().with((change) -> {
System.out.println("Item(s) added: " + change.getAddedSubList());
});
Observing user input every 200ms
FxMulti.createFrom().observableValue(textField)
.group().intoMultis().every(Duration.ofMillis(200))
.onItem().transformToMulti(items -> items.select().last()).merge()
.subscribe().with((change) -> {
System.out.println("User entered: " + change.getNewValue());
});