New API for comment input tags

This commit is contained in:
Chi Vinh Le
2018-03-21 16:46:08 +01:00
parent a73b93b0c3
commit 1256007eba
8 changed files with 75 additions and 20 deletions
+2
View File
@@ -1,6 +1,8 @@
export {
addCommentClassName,
removeCommentClassName,
// @Deprecated
addCommentBoxTag as addTag,
// @Deprecated
removeCommentBoxTag as removeTag,
} from 'coral-embed-stream/src/actions/stream';
+16 -1
View File
@@ -1,3 +1,18 @@
export const commentBoxTagsSelector = state => state.stream.commentBoxTags;
import once from 'lodash/once';
// @Deprecated
const showOldTagsWarningOnce = once(() => {
if (process.env.NODE_ENV !== 'production') {
console.warn(
'`commentBoxTagsSelector` is deprecated. Please switch to `input.tags` instead'
);
}
});
export const commentBoxTagsSelector = state => {
showOldTagsWarningOnce();
return state.stream.commentBoxTags;
};
export const commentClassNamesSelector = state =>
state.stream.commentClassNames;