Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import { RootState } from '@/store';
import { HNItem } from '@/types/hackernews';
export const selectPostsLoading = (state: RootState): boolean => state.posts.loading;
export const selectPostsError = (state: RootState): string | null => state.posts.error;
export const selectCurrentPage = (state: RootState): number => state.posts.currentPage;
export const selectTotalPages = (state: RootState): number => state.posts.totalPages;
export const selectNewPosts = (state: RootState): Partial<HNItem>[] => {
return state.posts.newPostItems;
};
export const selectTopPosts = (state: RootState): Partial<HNItem>[] => {
return state.posts.topPostItems;
};
|