mikebaum / RxUI

A toolkit for reactive (event/stream) based UI development on the JVM
Apache License 2.0
0 stars 0 forks source link

Add a scan operator #36

Closed mikebaum closed 8 years ago

mikebaum commented 8 years ago

Add a set of scan operators for the EventStream. Add a set of scan methods to both EventStream and PropertyStream. The scan methods will have the following signatures:

public class PropertyStream<M> {
...
    public final <R> EventStream<R> scan(BiFunction<M, R, R> scanFunction, R initialValue);
...
    public final <R> EventStream<R> scan(BiFunction<M, Optional<R>, R> scanFunction);
...
    public final EventStream<E> accumulate(BinaryOperator<E> accumulator, E initialValue)
}

and

public class EventStream<E> {
...
    public final <R> EventStream<R> scan(BiFunction<E, R, R> scanFunction, R initialValue);
...
    public final <R> EventStream<R> scan(BiFunction<E, Optional<R>, R> scanFunction);
...
    public final EventStream<E> accumulate(BinaryOperator<E> accumulator, E initialValue)
}
mikebaum commented 8 years ago

Fixed by PR #38.