generator-foo
Version:
Foo project scaffold generator based on generator-jam3
47 lines (41 loc) • 878 B
JavaScript
/**
* Created by mendieta on 11/4/16.
*/
export const LOADING = "loader/loading";
export const LOADED = "loader/loaded";
export const PROGRESS = "loader/progress";
const state = {
loading: false,
progress: 0
};
const actions = {
[]({commit}, loading){
commit(LOADING, loading);
},
[]({commit}){
commit(LOADED);
},
[]({commit}, progress){
commit(PROGRESS, progress);
}
};
const mutations = {
[](state){
state.loading = false;
},
[](state, loading){
state.loading = loading
},
[](state, progress){
state.progress = progress;
}
};
const getters = {
loading: state => {
return state.loading;
},
progress: state => {
return state.progress;
}
};
export default {state, actions, mutations, getters};