Adding the action methods

We also need to define the action methods. These are just functions that will help us create our actions, so it's less for us to type:

// counter/counter-list/counter-list.actions.tsimport {  ADD_COUNTER_ITEM,  REMOVE_COUNTER_ITEM} from "./counter-list.constants";export const addItem = (title, id) => ({  type: ADD_COUNTER_ITEM,  payload: { id, title }});export const removeItem = id => ({  type: REMOVE_COUNTER_ITEM,  payload: { id }});

Get Architecting Angular Applications with Redux, RxJS, and NgRx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.