This commit is contained in:
ntr committed 2022-09-03 15:03:16 +10:00
1 parent cf01670ee6
commit 0bf75d7faa
7 files changed
+30 -28

No files matched your search

+2 -19
View File
@@ -3,27 +3,10 @@ import unistore from 'unistore'
import http from './http';
export function createStore() {
export default function createStore() {
return unistore({
bundles: [],
offers: [],
user: null,
});
}
export const actions = store => ({
setUser: async function setUser(state, user, dest) {
route(dest);
return { user };
},
setOffers: async function setOffers(state, offers) {
return { offers };
},
logout: async function logout(store, e) {
await http.postLogout();
route('/login');
return { user: null };
},
});
};