vue-express-mongo-boilerplate
Version:
Express NodeJS application server boilerplate with Mongo and VueJS
42 lines (34 loc) • 714 B
JavaScript
import { ADD_MESSAGE, ADD_NOTIFICATION, SET_USER, SEARCH} from "./types";
const state = {
user: null,
notifications: [
{ id: 1, text: "Something happened!", time: 1, user: null }
],
messages: [],
searchText: ""
};
const mutations = {
[] (state, item) {
state.messages.splice(0);
state.messages.push(item);
},
[] (state, item) {
state.notifications.splice(0);
state.notifications.push(item);
},
[] (state, user) {
state.user = user;
},
[] (state, text) {
state.searchText = text;
}
};
import * as getters from "./getters";
import * as actions from "./actions";
export default {
namespaced: true,
state,
getters,
actions,
mutations
};