1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/actions/user_actions.js
2015-10-30 16:57:03 +01:00

28 lines
581 B
JavaScript

'use strict';
import { altUser } from '../alt';
import UserFetcher from '../fetchers/user_fetcher';
class UserActions {
constructor() {
this.generateActions(
'fetchCurrentUser',
'receiveCurrentUser',
'deleteCurrentUser'
);
}
logoutCurrentUser() {
UserFetcher.logout()
.then(() => {
this.actions.deleteCurrentUser();
})
.catch((err) => {
console.logGlobal(err);
});
}
}
export default altUser.createActions(UserActions);