const reducer = (state = [], action) => {
switch(action.type){
case 'ADD_TODO': return [...state, {text:action.text, id:Date.now()}]
case 'DELETE_TODO': return []
default: return state;
}
};

const store = createStore(reducer)

store.subscribe()


const onSubmit = e => {
e.preventDefault();
const toDo = input.value;
input.value = "";
store.dispatch({type:"ADD_TODO", text: toDo})
};

form.addEventListener('submit', onSubmit)



여기서 store.dispatch() 인자로 type 보내는 건 알았는데, 한개를 더 보내더라구요


그래서 action.type이 일치할때 [{text:action.text}]를 return 하던데


text(두번째 인자)는 어떤 걸 의미하는지 모르겠습니다