diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-06-02 09:51:39 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-06-02 09:51:39 -0700 |
commit | 7a388560d7d3ef22be0bdef1811414ad18ff2484 (patch) | |
tree | d81a64c8096328e0df0937261ef4fe8097707c41 /web/src/js/reducers/eventLog.js | |
parent | 9e3591e3c225c51d5a5b80eb331719d20d14dc48 (diff) | |
download | mitmproxy-7a388560d7d3ef22be0bdef1811414ad18ff2484.tar.gz mitmproxy-7a388560d7d3ef22be0bdef1811414ad18ff2484.tar.bz2 mitmproxy-7a388560d7d3ef22be0bdef1811414ad18ff2484.zip |
use object spread operator
While the spread operator is not part of ES6, React also uses it for JSX.
It makes sense for us to keep it in other parts of the codebase as well.
Diffstat (limited to 'web/src/js/reducers/eventLog.js')
-rw-r--r-- | web/src/js/reducers/eventLog.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/web/src/js/reducers/eventLog.js b/web/src/js/reducers/eventLog.js index 169cd306..9d078c14 100644 --- a/web/src/js/reducers/eventLog.js +++ b/web/src/js/reducers/eventLog.js @@ -10,9 +10,10 @@ const defaultVisibility = { const visibilityFilter = (state = defaultVisibility, action) => { switch (action.type) { case TOGGLE_EVENTLOG_FILTER: - return Object.assign({}, state, { + return { + ...state, [action.filter]: !state[action.filter] - }); + }; default: return state; } |