Skip to content

pine/rxkotlin-collections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RxKotlin Collections

Build Status Coverage Status Dependency Status FOSSA Status

Kotlin Collections Methods for RxJava2.

Getting Started

Please type it in your build.gradle file.

repositories {
    jcenter()
}

dependencies {
    compile 'moe.pine:rxkotlin-collections:0.2.10' // with RxJava
    compile 'moe.pine:rxkotlin-collections:0.3.0' // with RxJava 2
}

Usage

You can use Observable / Flowable extensions like Kotlin collections as the following.

import moe.pine.rx.collections.filterIndexed
import io.reactivex.Observable

val observable: Observable<String> = Observable.fromArray("a", "b", "c")
observable.filterIndexed { i, value -> i % 2 == 0 }.subscribe { println(it) }
// => "a", "c"

In addition, this library provides an extensions of the following.

Observable

  • filterIndexed
  • filterIsInstance
  • filterNot
  • flatten
  • forEachIndexed
  • isNotEmpty
  • mapIndexed
  • none
  • orEmpty
  • reduceIndexed
  • withIndex

Flowable

  • filterIndexed
  • filterIsInstance
  • filterNot
  • flatten
  • forEachIndexed
  • isNotEmpty
  • mapIndexed
  • none
  • orEmpty
  • reduceIndexed
  • withIndex

Test

$ ./gradlew clean test

Upload Bintray

$ export BINTRAY_USER=username
$ export BINTRAY_API_KEY=apiKey
$ ./gradlew clean assemble bintrayUpload

License

MIT © Pine Mizune

FOSSA Status