reactfx/src/main/java/org/reactfx/EventStreams.java
public static <T> EventStream<T> valuesOf(ObservableValue<T> observable) {
        return new EventStreamBase<T>() {
            @Override
            protected Subscription observeInputs() {
                ChangeListener<T> listener = (obs, old, val) -> emit(val);
                observable.addListener(listener);
                return () -> observable.removeListener(listener);
            }

            @Override
            protected void newObserver(Consumer<? super T> subscriber) {
                subscriber.accept(observable.getValue());
            }
        };
    }
public static <T> EventStream<T> valuesOf(ObservableValue<T> observable) {
        return new EventStreamBase<T>() {
            @Override
            protected Subscription observeInputs() {
                ChangeListener<T> listener = (obs, old, val) -> emit(val);
                observable.addListener(listener);
                return () -> observable.removeListener(listener);
            }

            @Override
            protected void newObserver(Consumer<? super T> subscriber) {
                subscriber.accept(observable.getValue());
            }
        };
    }
public static < T > EventStream < T > valuesOf ( ObservableValue < T > observable ) { return new EventStreamBase < T > ( ) { @ Override protected Subscription observeInputs ( ) { ChangeListener < T > listener = ( obs , old , val ) -> emit ( val ) ; observable . addListener ( listener ) ; return ( ) -> observable . removeListener ( listener ) ; } @ Override protected void newObserver ( Consumer < ? super T > subscriber ) { subscriber . accept ( observable . getValue ( ) ) ; } } ; }
Creates an event stream that emits the value of the given
{@code ObservableValue} immediately for every subscriber and then on
every change.
Creates an event stream that emits the value of the given {