我在reducer中有这段代码:
export const getSerieSuccess = (state = INITIAL_STATE, action) => {
return {
...state,
isLoadding: false,
serie: action.serie //action.serie is a object with id, name, genre e status
}
}
我想知道如果我执行
serie: action.serie
,我是传递一个值还是引用。我像这样执行它:export const getSerieSuccess = (state = INITIAL_STATE, action) => {
const serie = {...action.serie};
return {
...state,
isLoadding: false,
serie
}
}
函数式编程如何让WAI(Web Application Interface)更高效?