diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-07-19 03:13:39 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-07-19 03:13:39 -0700 |
commit | f356a84430f6606b2d7157eefd8e4a100fdd5dfb (patch) | |
tree | 038ccf7a15ce49d654e0b03ce73ba226d32c40f9 /web/src/js/ducks/utils/list.js | |
parent | 4ea6e61ea8ba57895451a9f76ec2c5e3c02829f3 (diff) | |
download | mitmproxy-f356a84430f6606b2d7157eefd8e4a100fdd5dfb.tar.gz mitmproxy-f356a84430f6606b2d7157eefd8e4a100fdd5dfb.tar.bz2 mitmproxy-f356a84430f6606b2d7157eefd8e4a100fdd5dfb.zip |
simplify web ui ducks
Diffstat (limited to 'web/src/js/ducks/utils/list.js')
-rw-r--r-- | web/src/js/ducks/utils/list.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/src/js/ducks/utils/list.js b/web/src/js/ducks/utils/list.js index 4f631590..fdeb5856 100644 --- a/web/src/js/ducks/utils/list.js +++ b/web/src/js/ducks/utils/list.js @@ -23,7 +23,7 @@ export default function reduce(state = defaultState, action) { } case UPDATE: { - const index = state.indexOf[action.id] + const index = state.indexOf[action.item.id] if (index == null) { return state @@ -36,7 +36,7 @@ export default function reduce(state = defaultState, action) { return { ...state, data, - byId: { ...state.byId, [action.id]: action.item } + byId: { ...state.byId, [action.item.id]: action.item } } } @@ -86,8 +86,8 @@ export function add(item) { /** * @public */ -export function update(id, item) { - return { type: UPDATE, id, item } +export function update(item) { + return { type: UPDATE, item } } /** |