nearly
This commit is contained in:
1 parent
cf01670ee6
commit
0bf75d7faa
7 files changed
+30
-28
No files matched your search
+2
-19
@@ -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 };
|
||||
},
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user