React Redux Tutorials - 5 - Actions
Actions
type
property that indicates the type of action being performed. type
property is typically defined as a string constants. // (1) define a string constant(to avoid spelling mistake)
const BUY_CAKE = 'BUY_CAKE'
// (2) define an action
// action 객체의 형태적 제한사항은 type 프로퍼티를 가져야한다는 것 외에는 없다.
{
type: BUY_CAKE,
info: 'first redux action'
}
// (3) implement an action creator(function that returns an action) - replaces step (2)
function buyCake() {
return {
type: BUY_CAKE,
info: 'first redux action'
}
}
なぜaction creatorの形式で書くのですか?🔗 Why action creators?
Reference
この問題について(React Redux Tutorials - 5 - Actions), 我々は、より多くの情報をここで見つけました https://velog.io/@jheeju/React-Redux-Tutorials-5-Actionsテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol