# Data Flow Let's build a simple counter app with Vuex to get a better understanding of the data flow inside Vuex apps. Note this is a trivial example solely for the purpose of explaining the concepts - in practice you don't need Vuex for such simple tasks. ### Setup ``` js // store.js import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) ``` ### Define App State ``` js const state = { count: 0 } ``` ### Define Possible State Mutations ``` js const mutations = { INCREMENT (state) { state.count++ }, DECREMENT (state) { state.count-- } } ``` ### Define Callable Actions ``` js const actions = { increment: 'INCREMENT', decrement: 'DECREMENT' } ``` ### Create a Vuex Store ``` js export default new Vuex.Store({ state, mutations, actions }) ``` ### Use It in a Vue Component **Template** ``` html