我有一个看起来像的商店:
[object]
0: Object
001: object
completed: false
我的问题:我想要001 id替换0 id - 我该如何实现?
我的减速机是:
if (action.type === 'ADD_USER') {
const nextState = [
...state, {
[action.userId]: {
['domain']: action.domain,
['version']: action.version,
['completed'] : false
}
}
]
return nextState
}