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


why use behavior subject with sharereplay?
get todos() is also overkill. It's not a good way to get data from observer, except in async pipe. For adding todo we should use scan operator, same as for mark as completed. Subject with shareReplay (or ReplaySubject) solves all the problems and BehaviorSubject is really redundant here.


Thanks for the feedback, updated.

Code of Conduct Report abuse