Files
remark42/frontend/app/store/comments/getters.ts
T
2022-01-18 01:38:30 -06:00

13 lines
369 B
TypeScript

import { Comment, CommentMode } from 'common/types';
import { StoreState } from '../index';
export const getCommentMode =
(id: Comment['id']) =>
(state: StoreState): CommentMode => {
if (state.comments.activeComment === null || state.comments.activeComment.id !== id) {
return CommentMode.None;
}
return state.comments.activeComment.state;
};