Kotlin Android debounce

I’ve created a gist with three debounce operators inspired by this elegant solution from Patrick where I added two more similar cases: throttleFirst and throttleLatest. Both of these are very similar to their RxJava analogues (throttleFirst, throttleLatest). throttleLatest works similar to debounce but it operates on time intervals and returns the latest data for each … Read more

Kotlin Extension Functions suddenly require api level 24

What you are using is not kotlin.collections.MutableMap.forEach. What you are using seems to be Map.forEach in Java 8. Refer to this article: http://blog.danlew.net/2017/03/16/kotlin-puzzler-whose-line-is-it-anyways/ This seems to be a common mistake. Java 8 is well-supported from Android API level 24. For short, do not use forEach like map.forEach { t, u -> Log.i(“tag”, t + u) … Read more