import { TodoListItem } from './todo-list-item' ; import { TodoListComponent } from './todo-list.component' ; import { TodoState } from '../todo.module.state' ; import { ReduxReducer } from '../../../harmowatch/ngx-redux-core/decorators/index' ; import { ReduxActionWithPayload } from '../../../harmowatch/ngx-redux-core/interfaces/redux-action-with-payload.interface' ; export class TodoListReducer { @ ReduxReducer ( TodoListComponent . prototype . add ) addTodo ( state , action ) { return { ... state , items : state . items . concat ( action . payload ) , } ; } @ ReduxReducer ( TodoListComponent . prototype . remove ) removeTodo ( state , action ) { return { ... state , items : state . items . filter ( todo => todo . uuid !== action . payload . uuid ) } ; } }