Merge branch 'master' into permalink-enh

This commit is contained in:
Kiwi
2018-02-28 14:58:32 +01:00
committed by GitHub
108 changed files with 2460 additions and 1167 deletions
+21
View File
@@ -0,0 +1,21 @@
export default class Action {
listeners = [];
listen = cb => {
this.listeners.push(cb);
};
unlisten = cb => {
this.listeners = this.listeners.filter(i => i !== cb);
};
event = { listen: this.listen, unlisten: this.unlisten };
call(...args) {
this.listeners.forEach(cb => cb(...args));
}
asEvent() {
return this.event;
}
}
@@ -1,9 +1,15 @@
import { MERGE_CONFIG } from '../constants/config';
import { LOGOUT } from '../constants/auth';
const initialState = {};
export default function config(state = initialState, action) {
switch (action.type) {
case LOGOUT:
return {
...state,
auth_token: null,
};
case MERGE_CONFIG:
return {
...state,