thomasnield / RxKotlinFX

Kotlin extensions to the RxJavaFX framework
Apache License 2.0
175 stars 13 forks source link

doOnXXXCount() Operators #4

Closed thomasnield closed 8 years ago

thomasnield commented 8 years ago

Not long ago I created some Operators analogous to doOnNext(), doOnError(), and doOnCompleted() except it would provide the emission counts and be able to use them for side effects.

This could be helpful for providing UI status updates through a side effect showing the number of items processed.

val mySource = Observable.just("Alpha","Beta","Gamma")
mySource.doOnNextCount { println("$it items processed")}.subscribe()

OUTPUT

1 items processed
2 items processed
3 items processed

If I go forward with this, then the next question is should there be FX and non-FX version... I'm going to guess yes. I'll think about it over the next few days.

thomasnield commented 8 years ago

These have been implemented with new release. See README.