diff options
Diffstat (limited to 'web/src/js/reducers')
-rw-r--r-- | web/src/js/reducers/eventLog.js | 30 | ||||
-rw-r--r-- | web/src/js/reducers/index.js | 8 |
2 files changed, 38 insertions, 0 deletions
diff --git a/web/src/js/reducers/eventLog.js b/web/src/js/reducers/eventLog.js new file mode 100644 index 00000000..169cd306 --- /dev/null +++ b/web/src/js/reducers/eventLog.js @@ -0,0 +1,30 @@ +import {combineReducers} from 'redux' +import {TOGGLE_EVENTLOG_FILTER} from "../reduxActions" + +const defaultVisibility = { + "debug": false, + "info": true, + "web": true +}; + +const visibilityFilter = (state = defaultVisibility, action) => { + switch (action.type) { + case TOGGLE_EVENTLOG_FILTER: + return Object.assign({}, state, { + [action.filter]: !state[action.filter] + }); + default: + return state; + } +}; + +const entries = (state = [], action) => { + return state; +}; + +const eventLog = combineReducers({ + visibilityFilter, + entries +}); + +export default eventLog diff --git a/web/src/js/reducers/index.js b/web/src/js/reducers/index.js new file mode 100644 index 00000000..a8b2edbf --- /dev/null +++ b/web/src/js/reducers/index.js @@ -0,0 +1,8 @@ +import {combineReducers} from 'redux'; +import eventLog from './eventlog' + +const mitmproxyApp = combineReducers({ + eventLog +}); + +export default mitmproxyApp |