December 2019
Intermediate to advanced
598 pages
12h 21m
English
Our final action creator is for clearing the posted question result. Let's implement this in one step:
export const clearPostedQuestionActionCreator: ActionCreator< PostedQuestionAction> = () => { const postedQuestionAction: PostedQuestionAction = { type: 'PostedQuestion', result: undefined, }; return postedQuestionAction;};
This action creator is much simpler because it is synchronous – we simply return a PostedQuestion action with an undefined result property.
So, action creators are straightforward to implement but the type annotations are a little tricky, particularly when they are asynchronous.
Our Redux store is shaping up nicely now. Let's move on and create a reducer. ...
Read now
Unlock full access