function counter(state, action) {. if (typeof state === 'undefined') {. return 0. } switch (action.type) {. case 'INCREMENT': return state + 1.
確定! 回上一頁