-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalidation factory for javafx.beans.Observable #47
Comments
Makes perfect sense. I'll implement this later in 1.0 as well as the 2.0 branch. |
Wouldn't it make more sense to emit an public static <T> Observable<ObservableValue<T>> fromInvalidations(final ObservableValue<T> fxObservable) {
return Observable.create(subscriber -> {
final InvalidationListener listener = s -> subscriber.onNext(fxObservable);
fxObservable.addListener(listener);
subscriber.add(JavaFxSubscriptions.unsubscribeInEventDispatchThread(() -> fxObservable.removeListener(listener)));
});
} Would it also make sense to overload a public static <T> Observable<Property<T>> fromInvalidations(final Property<T> fxProperty) {
return Observable.create(subscriber -> {
final InvalidationListener listener = s -> subscriber.onNext(fxProperty);
fxProperty.addListener(listener);
subscriber.add(JavaFxSubscriptions.unsubscribeInEventDispatchThread(() -> fxProperty.removeListener(listener)));
});
} |
The main difference is, that |
@protogenes that makes sense. Okay I'll implement your way. |
@protogenes Implemented in 1.x. I'll do 2.x as soon as I merge the new Scheduler for that branch. Let me know if that's ready. |
Add a factory for invalidations of any FX observable.
I think propagating the FX observable instead of some constant is of better value.
The text was updated successfully, but these errors were encountered: