-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print errors to stderr if no handler provided.
Rename watch(onEvent, onError) to subscribe(...). Implement subscribe(onEvent) as subscribe(onEvent, Throwable::printStackTrace)
- Loading branch information
1 parent
484d70e
commit 54810d4
Showing
10 changed files
with
86 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
package org.reactfx; | ||
|
||
import java.util.function.BiConsumer; | ||
import java.util.function.Consumer; | ||
|
||
import org.reactfx.util.TriConsumer; | ||
|
||
interface PoorMansBiStream<A, B> extends BiEventStream<A, B> { | ||
|
||
@Override | ||
default Subscription subscribe(BiConsumer<? super A, ? super B> subscriber) { | ||
return subscribe(t -> subscriber.accept(t._1, t._2)); | ||
default Subscription subscribe( | ||
BiConsumer<? super A, ? super B> subscriber, | ||
Consumer<? super Throwable> onError) { | ||
return subscribe(t -> subscriber.accept(t._1, t._2), onError); | ||
} | ||
} | ||
|
||
interface PoorMansTriStream<A, B, C> extends TriEventStream<A, B, C> { | ||
|
||
@Override | ||
default Subscription subscribe(TriConsumer<? super A, ? super B, ? super C> subscriber) { | ||
return subscribe(t -> subscriber.accept(t._1, t._2, t._3)); | ||
default Subscription subscribe( | ||
TriConsumer<? super A, ? super B, ? super C> subscriber, | ||
Consumer<? super Throwable> onError) { | ||
return subscribe(t -> subscriber.accept(t._1, t._2, t._3), onError); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters