Skip to content

Commit

Permalink
Add supply(constVal) combinator.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasMikula committed Jun 6, 2014
1 parent 07c73b2 commit 83de729
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions reactfx/src/main/java/org/reactfx/EventStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ default EventStream<T> distinct() {
return new DistinctStream<>(this);
}

/**
* Returns an event stream that emits the given constant value every time
* this stream emits a value.
*/
default <U> EventStream<U> supply(U value) {
return map(x -> value);
}

/**
* Returns an event stream that emits a value obtained from the given
* supplier every time this event stream emits a value.
Expand Down

0 comments on commit 83de729

Please sign in to comment.