refactor vuex
This commit is contained in:
1 parent
9c69e96416
commit
565b367c59
20 files changed
+264
-178
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { ActionContext } from 'vuex';
|
||||
import { IRootState, IToken } from '../common/models';
|
||||
import { IApplication, IUser } from '@/operators';
|
||||
|
||||
export const resetToken = ({ commit }: ActionContext<IRootState, IRootState>) => {
|
||||
commit('resetToken');
|
||||
};
|
||||
|
||||
export const setToken = ({ commit }: ActionContext<IRootState, IRootState>, payload: IToken) => {
|
||||
commit('setToken', payload);
|
||||
};
|
||||
|
||||
export const setUser = ({ commit }: ActionContext<IRootState, IRootState>, payload: IUser) => {
|
||||
commit('setUser', payload);
|
||||
};
|
||||
|
||||
export const setApplications = ({ commit }: ActionContext<IRootState, IRootState>, payload: IApplication[]) => {
|
||||
commit('setApplications', payload);
|
||||
};
|
||||
|
||||
export default {
|
||||
resetToken,
|
||||
setToken,
|
||||
setUser,
|
||||
setApplications
|
||||
};
|
||||
Reference in new issue
Block a user