I am currently working on setting up a Vuex plugin where I want to make the undo
function accessible for use in my component's click events.
// plugin.js
const timeTravel = store => {
// .. other things
function undo () {
store.commit('commit_something', payload)
}
}
Can someone guide me on how to properly expose the undo
function to my components so that I can effectively utilize it?