Skip to content

Commit

Permalink
feat: something more...
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Pasenidis committed Apr 24, 2020
1 parent 409914c commit 06b2fb7
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions src/store/modules/App.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { ActionContext } from "vuex";

export default {
namespaced: true,
state: { token: "", HTTP: undefined },
getters: {
token: (
state: { token: string; HTTP: any },
getters: { token: Function; HTTP: Function }
) => {
getters;
return state.token;
},
HTTP: (
state: { token: string; HTTP: any },
getters: { token: Function; HTTP: Function }
) => {
getters;
return state.HTTP;
},
},
mutations: {
setToken(state: { token: string; HTTP: any }, payload: { token: string }) {
state.token = payload.token;
},
setHTTP(state: { token: string; HTTP: any }, payload: { HTTP: any }) {
state.HTTP = payload.HTTP;
},
},
actions: {
setToken: (
context: ActionContext<
{ token: string; HTTP: any },
{ token: string; HTTP: any }
>,
payload: { token: string }
) => context.commit("setToken", payload),
setHTTP: (
context: ActionContext<
{ token: string; HTTP: any },
{ token: string; HTTP: any }
>,
payload: { HTTP: any }
) => context.commit("setHTTP", payload),
},
};

0 comments on commit 06b2fb7

Please sign in to comment.