diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-06-02 23:40:30 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-06-02 23:40:30 -0700 |
commit | 7afac747a8448ac524774a23c12ab23c9d4675f6 (patch) | |
tree | ec520adeba62b543c1809021bbd58a8160c2df1a /web/src/js/ducks/list.js | |
parent | 7c63aa3708a09b997575cb85cb6dfaaa41082fab (diff) | |
download | mitmproxy-7afac747a8448ac524774a23c12ab23c9d4675f6.tar.gz mitmproxy-7afac747a8448ac524774a23c12ab23c9d4675f6.tar.bz2 mitmproxy-7afac747a8448ac524774a23c12ab23c9d4675f6.zip |
web: reduxify event log store
Diffstat (limited to 'web/src/js/ducks/list.js')
-rw-r--r-- | web/src/js/ducks/list.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/web/src/js/ducks/list.js b/web/src/js/ducks/list.js new file mode 100644 index 00000000..0b3771e2 --- /dev/null +++ b/web/src/js/ducks/list.js @@ -0,0 +1,21 @@ +export const ADD = 'add' + +const defaultState = { + list: [], + //isFetching: false, + //updateBeforeFetch: [], + indexOf: {}, + //views: {} +}; + +export default function getList(state = defaultState, action = {}) { + switch (action.cmd) { + case ADD: + return { + list: [...state.list, action.data], + indexOf: {...state.indexOf, [action.data.id]: state.list.length}, + } + default: + return state + } +}
\ No newline at end of file |