December 2019
Intermediate to advanced
598 pages
12h 21m
English
In this section, we are going to implement the type for the state object in our store, along with the initial value for the state. Follow these steps to do so:
import { QuestionData } from './QuestionsData';
interface QuestionsState { readonly loading: boolean; readonly unanswered: QuestionData[] | null; readonly postedResult?: QuestionData;}export interface AppState { readonly questions: QuestionsState;}
So, our store is going to have a questions property that, in turn, contains an array of unanswered questions or null in an unanswered property. The questions property ...
Read now
Unlock full access