Created
May 28, 2019 17:57
-
-
Save artberri/cf7b1e43bca822cc241a3ee9a8e3b046 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CommandHandler, Service } from '../../../../framework'; | |
import { EditTodoCommand, IEditTodoPayload } from '../edit-todo.command'; | |
import { TodosState } from '../../../state'; | |
@Service() | |
export class EditTodoCommandHandler extends CommandHandler<IEditTodoPayload> { | |
constructor( | |
private readonly todosState: TodosState | |
) { | |
super(EditTodoCommand); | |
} | |
public handle(payload: IEditTodoPayload): void { | |
this.todosState.edit(payload.todo, payload.title); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment