Closed mahmed1987 closed 7 years ago
return Observable.concat(localTask, remoteTask).**filter(task -> task != null)**.first()
.map(task -> {
if (task == null) {
throw new NoSuchElementException("No task found with taskId " + taskId);
}
return task;
});
I believe it should be like above ? . I am actually new to Rx so I am not sure if its something you guys missed or it is something intentionally left.
Code changed meanwhile. Not applicable anymore.
Line Number 263 at https://github.com/googlesamples/android-architecture/blob/dev-todo-mvvm-rxjava/todoapp/app/src/main/java/com/example/android/architecture/blueprints/todoapp/data/source/TasksRepository.java
has the following return
`return Observable.concat(localTask, remoteTask).first() .map(task -> { if (task == null) { throw new NoSuchElementException("No task found with taskId " + taskId); } return task; });
`
aren't we missing a filter call before first ? . I can't make sense of this without the filter applied. Please elaborate if the filter is correctly not applied here.