Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Created June 17, 2019 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavilanch/3bdc8b518f708fac2fdf756bce997e98 to your computer and use it in GitHub Desktop.
Save gavilanch/3bdc8b518f708fac2fdf756bce997e98 to your computer and use it in GitHub Desktop.
handleModalTodoFormClose(response) {
// is response an object?
if (response === Object(response)) {
if (response.createMode) {
response.todo.id = response.id;
this.todos.unshift(response.todo);
} else {
let index = this.todos.findIndex(value => value.id == response.id);
this.todos[index] = response.todo;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment