loading...

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

TOP OF THREAD FULL DISCUSSION
re: Hi, in the user's code I've noticed, that you pass 'event' to the remove method: (remove)="todosStore.removeTodo($event)" Shouldn't it be just an ...
 

both are correct, if the app-todo-component outputs the todo id in the event, it'll still work

depends on the implementation of the @Ouptut

 

Yea, I completely agree, they are the same, I guess there is a real small advantage to use todo.id instead of $event - if we use todo.id we explicitly say that we wanna to use id property from list of todos, otherwise if we use $event we delegate the responsibility to the child component to use 'remove' event properly (pass the correct value).

code of conduct - report abuse