Skip to content

Instantly share code, notes, and snippets.

@idoshamun
Created October 9, 2018 06:14
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 idoshamun/ee53ef023305b3619f08c9c263ad7e1e to your computer and use it in GitHub Desktop.
Save idoshamun/ee53ef023305b3619f08c9c263ad7e1e to your computer and use it in GitHub Desktop.
Optimistic Offline-First Apps With Vuex
const plugin = (store) => {
store.subscribe((mutation, state) => {
switch (mutation.type) {
case '...':
// dispatch request
break;
case '...':
// dispatch request
break;
default:
// Ignore default case
}
});
};
export default plugin;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment