Download wp-calypso/client/state/comments/selectors/get-site-comment-counts.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 495 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/comments/selectors/get-site-comment-counts.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/comments/selectors/get-site-comment-counts.js
-
curl -L -o get-site-comment-counts.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/comments/selectors/get-site-comment-counts.js
495 Bytes
| import 'calypso/state/comments/init'; | |
| /** | |
| * Return comment counts for the given site and post ID, if applicable. | |
| * @param {Object} state Redux state | |
| * @param {number} siteId Site identifier | |
| * @param {number} [postId] Post identifier | |
| * @returns {Object} The requested comment counts | |
| */ | |
| export function getSiteCommentCounts( state, siteId, postId ) { | |
| if ( postId ) { | |
| return state.comments.counts[ siteId ]?.[ postId ] ?? null; | |
| } | |
| return state.comments.counts[ siteId ]?.site ?? null; | |
| } | |