-
-
Save davidalves1/fa7b6046865512ae5f8480174f3d8238 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createStore({ state, mutations }) { | |
return { | |
state: Vue.observable(state), | |
commit(key, ...args) { | |
mutations[key](state, ...args) | |
} | |
} | |
} | |
const store = createStore({ | |
state: { count: 0 }, | |
mutations: { | |
inc (state) { | |
state.count++ | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment