import { IReviewFormState } from '@client/forms/register/reviewReducer' ; import { IStoreState } from '@client/store' ; const getPartialState = ( store ) : IReviewFormState => store . reviewForm ; function getKey < K extends keyof IReviewFormState > ( store , key ) { return getPartialState ( store ) [ key ] ; } export const getReviewForm = ( store ) : IReviewFormState [ 'reviewForm' ] => getKey ( store , 'reviewForm' ) ;