All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.reactfx.SuspendedWhenStream Maven / Gradle / Ivy

There is a newer version: 1.11
Show newest version
package org.reactfx;

import javafx.beans.value.ObservableValue;

class SuspendedWhenStream extends EventStreamBase {
    private final SuspendableEventStream source;
    private final ObservableValue condition;

    public SuspendedWhenStream(
            SuspendableEventStream source,
            ObservableValue condition) {
        this.source = source;
        this.condition = condition;
    }

    @Override
    protected Subscription observeInputs() {
        Subscription s1 = source.suspendWhen(condition);
        Subscription s2 = source.subscribe(this::emit);
        return s1.and(s2);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy