in todoapp/app/src/main/java/com/example/android/architecture/blueprints/todoapp/statistics/effecthandlers/StatisticsEffectHandlers.java [43:55]
private static ObservableTransformer<LoadTasks, StatisticsEvent> loadTasksHandler(
TasksLocalDataSource localSource) {
return effects ->
effects.flatMap(
loadTasks ->
localSource
.getTasks()
.toObservable()
.take(1)
.map(ImmutableList::copyOf)
.map(StatisticsEvent::tasksLoaded)
.onErrorReturnItem(tasksLoadingFailed()));
}