react-code-dataset / wp-calypso /client /state /comments /selectors /get-post-total-comments-count.js
react-code-dataset / wp-calypso /client /state /comments /selectors /get-post-total-comments-count.js
Download wp-calypso/client/state/comments/selectors/get-post-total-comments-count.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/comments/selectors/get-post-total-comments-count.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/comments/selectors/get-post-total-comments-count.js
-
curl -L -o get-post-total-comments-count.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/comments/selectors/get-post-total-comments-count.js
469 Bytes
| import 'calypso/state/comments/init'; | |
| /** | |
| * Get total number of comments on the server for a given post | |
| * @param {Object} state redux state | |
| * @param {number} siteId site identification | |
| * @param {number} postId site identification | |
| * @returns {number} total comments count on the server. if not found, assume infinity | |
| */ | |
| export function getPostTotalCommentsCount( state, siteId, postId ) { | |
| return state.comments.totalCommentsCount[ `${ siteId }-${ postId }` ]; | |
| } | |