0
如何轉換下面的代碼ES6:(尤其是後newState.guests = []
如何ES5轉換器ES6在終極版的減速
case ActionTypes.GetInviteFulfilled: {
const { host, agenda, guests } = action.invite;
const newState = Object.assign({}, state, {
inProgress: false,
success: 'Got invite.',
host,
agenda
});
newState.guests = [];
if (guests) {
newState.guests = Object.keys(guests).map(k => guests[k]);
}
return newState;
}