Skip to content

1.0.7

Compare
Choose a tag to compare
@benjchristensen benjchristensen released this 21 Feb 05:01
· 1033 commits to 1.x since this release

This release includes some bug fixes along with a new operator and performance enhancements.

Experimental Operator

Note that these APIs may still change or be removed altogether since they are marked as @Experimental.

withLatestFrom(Observable, Selector)

This allows combining all values from one Observable with the latest value from a second Observable at each onNext.

For example:

Observable<Long> a = Observable.interval(1, TimeUnit.SECONDS);
Observable<Long> b = Observable.interval(250, TimeUnit.MILLISECONDS);


a.withLatestFrom(b, (x, y) -> new long[] { x, y })
        .toBlocking()
        .forEach(pair -> System.out.println("a: " + pair[0] + " b: " + pair[1]));

This outputs:

a: 0 b: 3
a: 1 b: 6
a: 2 b: 11
a: 3 b: 15
a: 4 b: 19
a: 5 b: 23
a: 6 b: 27

Changes

#2760 Operator: WithLatestFrom
#2762 Optimized isUnsubscribed check
#2759 Observable.using should use unsafeSubscribe and enable eager disposal
#2655 SwitchOnNext: fix upstream producer replacing the ops own producer

Artifacts: Maven Central