``` var obs = map { success(it) } if (idle...
# rx
u
Copy code
var obs = map { success(it) }
        if (idle != null) {
            obs = obs.endWith(idle())
        }
        return obs.doOnError(LOG::e)
                .onErrorReturn { t -> error(defaultErrorTransformer.throwableToType(t, customErrorTransformation)) }
                .observeOn(AndroidSchedulers.mainThread())
                .startWith(started())
­čĹŹ 2
e
Copy code
map { success(it) }
.doOnError(LOG::e)
.onErrorReturn { t -> error(defaultErrorTransformer.throwableToType(t, customErrorTransformation)) }
.observeOn(AndroidSchedulers.mainThread())
.startWith(started())
.endWith(if (idle != null) idle() else Observable.empty())
u
empty, interesting
I ended up writing extension function but I like this too