In this section, we are going to create actions that will initiate changes to our store state. Let's get started:
- We are going to create the actions in Store.ts. So, let's add the following import statement at the top of this file:
import { Action } from 'redux';
The Action type is a base type from the core Redux library that contains a type property that we can use to type in our actions.
- Let's create an action interface that will indicate that unanswered questions are being fetched from the server:
interface GettingUnansweredQuestionsAction
extends Action<'GettingUnansweredQuestions'> {}
Notice that the interface uses the extends keyword.
Interfaces can inherit properties and methods from another interface using the extends keyword. The interface that's being inherited from is specified after the extends keyword...