re: Simple state management in Angular with only Services and RxJS VIEW POST


Thanks for this post, it's help us very well.

When you define the "readonly completedTodos$" in the service, you use the getter (this.todos) in the map operator to filter the stream. What doesn't use directly the "todos" var entry from the map operator like this:
readonly completedTodos$ = this.todos$.pipe(
map(todos => todos.filter(todo => todo.isCompleted))
) ?


Hey, both do the same thing, but yes you are correct, using todos from the map makes more sense, i updated the article.

code of conduct - report abuse