This is a humble library dedicated to making the life of developers easier.
Be sure to have JCenter in the base gradle file.
allprojects {
repositories {
jcenter()
}
}
Then it's a matter of adding the dependency.
dependencies {
// Churros
implementation "com.asapp.churros:churros:0.2.0"
}
val okHttpClient = OkHttpClient.Builder()
.addInterceptor(interceptor)
.runIf(isVerbose) {
val loggingInterceptor =
HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)
addNetworkInterceptor(loggingInterceptor)
}
.build()
This code will work happily.
enum class Snack {
HUMUS, CHIPS, GUACAMOLE
}
val today = GUACAMOLE
when (today) {
HUMUS -> getPita()
CHIPS -> buyGuacamole()
}
This code will complain that you missed thinking about Guacamole
enum class Snack {
HUMMUS, CHIPS, GUACAMOLE
}
val today = GUACAMOLE
when (today) {
HUMMUS -> getPita()
CHIPS -> buyGuacamole()
}
.exhaustive()
activity.toast(R.string.auth_error)
fun getAccountInDB(id: Int): Single<Account> = Single.just(Account(id))
fun getItemsFromNetwork(): Single<List<Int>> = Single.just(listOf(101, 42, 3))
val result: Single<List<Account>> = getItemsFromNetwork()
.flatMapList { getAccountInDB(it) }