Skip to content
Snippets Groups Projects
Commit 3482f28a authored by fibasile's avatar fibasile
Browse files

added new stores

parent c5c2a25c
No related branches found
No related tags found
No related merge requests found
Showing
with 114 additions and 9 deletions
/*
export function someAction (context) {
}
*/
/*
export function someGetter (state) {
}
*/
......@@ -5,8 +5,8 @@ import * as actions from './actions'
export default {
namespaced: true,
state,
getters,
mutations,
actions,
state
actions
}
/*
export function someMutation (state) {
}
*/
File moved
/*
export function someAction (context) {
}
*/
/*
export function someGetter (state) {
}
*/
import state from './state'
import * as getters from './getters'
import * as mutations from './mutations'
import * as actions from './actions'
export default {
namespaced: true,
state,
getters,
mutations,
actions
}
/*
export function someMutation (state) {
}
*/
export default {
//
}
......@@ -6,6 +6,11 @@ import Vuex from "vuex";
Vue.use(Vuex);
import auth from "./auth";
import categories from "./categories";
import projects from "./projects";
import collections from "./collections";
import ui from "./ui";
/*
* If not building with SSR mode, you can
* directly export the Store instantiation
......@@ -15,7 +20,11 @@ export default function(/* { ssrContext } */) {
const Store = new Vuex.Store({
modules: {
// example
auth
auth,
categories,
projects,
collections,
ui
},
// enable strict mode (adds overhead!)
......
export function someAction (/* context */) {
}
export function someGetter (/* state */) {
}
export function someMutation (/* state */) {
}
/*
export function someAction (context) {
}
*/
import "firebase/app";
export function setProjectsRef({ commit }, ref) {}
export function setCategoryRef({ commit }, ref) {}
export function loadAllProjects({ state, dispatch }) {
const db = firebase.database();
var ref = db
.ref("library/projects")
.orderByKey()
.limitToFirst(state.limit);
dispatch("setProjectsRef", ref);
}
export function loadCategory({ state, dispatch }, category_id) {
const db = firebase.database();
var projects_ref = db
.ref("library/projects")
.orderByChild("category")
.equalTo(category_id)
.limitToFirst(state.limit);
var cat_ref = db.ref("library/categories/" + category_id);
dispatch("setProjectsRef", projects_ref);
dispatch("setCategoryRef", cat_ref);
}
/*
export function someGetter (state) {
}
*/
import state from './state'
import * as getters from './getters'
import * as mutations from './mutations'
import * as actions from './actions'
export default {
namespaced: true,
state,
getters,
mutations,
actions
}
/*
export function someMutation (state) {
}
*/
export default {
//
limit: 50,
projects: []
};
/*
export function someAction (context) {
}
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment