Skip to content

Instantly share code, notes, and snippets.

@Dirk94
Last active February 1, 2021 12:59
Show Gist options
  • Select an option

  • Save Dirk94/781456a791af7e6124409a0e185197fa to your computer and use it in GitHub Desktop.

Select an option

Save Dirk94/781456a791af7e6124409a0e185197fa to your computer and use it in GitHub Desktop.
actions: {
async addTodo({ commit }, todo) {
// This is a fake function to illustrate the example.
const response = await postRequestToTheAPI(todo);
if (response.isOk) {
commit('ADD_TODO', todo);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment