Skip to content

Instantly share code, notes, and snippets.

@bakasura980
Created April 29, 2020 12:20
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 bakasura980/9a5f98b3fd18232f583b6c0b95ae11d8 to your computer and use it in GitHub Desktop.
Save bakasura980/9a5f98b3fd18232f583b6c0b95ae11d8 to your computer and use it in GitHub Desktop.
EOSLime shape blockchain service - removeTodo function
async removeTodo (todo) {
// Call contract method "remove" in the blockchain
const txReceipt = await this.todoContract.remove(todo.id);
// Remove todo from local todosList cache
const todoIndex = this.todosList[todo.state].findIndex((todoElement) => todoElement.id === todo.id);
this.todosList[todo.state].splice(todoIndex, 1);
return txReceipt;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment