Skip to content

Instantly share code, notes, and snippets.

@artberri
Created May 28, 2019 17:57
Show Gist options
  • Save artberri/cf7b1e43bca822cc241a3ee9a8e3b046 to your computer and use it in GitHub Desktop.
Save artberri/cf7b1e43bca822cc241a3ee9a8e3b046 to your computer and use it in GitHub Desktop.
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