RxJava Window If Changed

An RxJava transformer which combines replay(1), publish(), and refCount() operators.

License

License

GroupId

GroupId

com.jakewharton.rx
ArtifactId

ArtifactId

window-if-changed
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

RxJava Window If Changed
An RxJava transformer which combines replay(1), publish(), and refCount() operators.

Download window-if-changed

How to add to project

<!-- https://jarcasting.com/artifacts/com.jakewharton.rx/window-if-changed/ -->
<dependency>
    <groupId>com.jakewharton.rx</groupId>
    <artifactId>window-if-changed</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.jakewharton.rx/window-if-changed/
implementation 'com.jakewharton.rx:window-if-changed:1.0.0'
// https://jarcasting.com/artifacts/com.jakewharton.rx/window-if-changed/
implementation ("com.jakewharton.rx:window-if-changed:1.0.0")
'com.jakewharton.rx:window-if-changed:jar:1.0.0'
<dependency org="com.jakewharton.rx" name="window-if-changed" rev="1.0.0">
  <artifact name="window-if-changed" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.jakewharton.rx', module='window-if-changed', version='1.0.0')
)
libraryDependencies += "com.jakewharton.rx" % "window-if-changed" % "1.0.0"
[com.jakewharton.rx/window-if-changed "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
io.reactivex.rxjava2 : rxjava jar 2.0.1
org.reactivestreams : reactive-streams jar 1.0.0

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

RxJava Window If Changed

The WindowIfChanged operator for RxJava 2 divides an Observable that emits items into an Observable that emits Observables, each one of which emits some subset of the items from the original source. The items in each inner Observable all have a common "key" based on a key selector function. A new inner Observable is emitted and the previous inner Observable completes each time the key changes from the previous item.

marble diagram

Observable<Actions> actions = //...

Observable<GroupedObservable<String, Action>> targetedActions =
    WindowIfChanged.create(actions, action -> action.target);

Download

Maven:

<dependency>
  <groupId>com.jakewharton.rx</groupId>
  <artifactId>window-if-changed</artifactId>
  <version>1.0.0</version>
</dependency>

Gradle:

compile 'com.jakewharton.rx:window-if-changed:1.0.0'

If you use Kotlin, a package with an extension method for Observable is provided. Replace the window-if-changed artifact ID above with window-if-changed-kotlin.

Snapshots of the development version are available in Sonatype's snapshots repository.

License

Copyright 2016 Jake Wharton

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
1.0.0