Skip to content

Instantly share code, notes, and snippets.

@touhidrahman
Created February 6, 2021 15:31
Show Gist options
  • Select an option

  • Save touhidrahman/e64c60b347b3d0a1ed63009d4fab21c3 to your computer and use it in GitHub Desktop.

Select an option

Save touhidrahman/e64c60b347b3d0a1ed63009d4fab21c3 to your computer and use it in GitHub Desktop.
Medium article state management - initial state
export interface ViewArticlePageState {
id: number
article: Article
comments: Comment[]
searchTerm: string
loading: boolean
commentsPagination: {
_limit: number
_start: number
_sort: string
}
}
const initialState: ViewArticlePageState = {
id: undefined,
article: null,
comments: [],
loading: false,
searchTerm: '',
commentsPagination: {
_limit: 10,
_start: 0,
_sort: '',
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment