Download wp-calypso/client/state/comments/selectors/get-site-comment.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 537 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/comments/selectors/get-site-comment.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/comments/selectors/get-site-comment.js
-
curl -L -o get-site-comment.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/comments/selectors/get-site-comment.js
537 Bytes
| import { find } from 'lodash'; | |
| import { getSiteComments } from 'calypso/state/comments/selectors'; | |
| import 'calypso/state/comments/init'; | |
| /** | |
| * Returns a comment for the specified site and comment ID. | |
| * @param {Object} state Redux state | |
| * @param {number} siteId Site identifier | |
| * @param {number} commentId Comment identifier | |
| * @returns {Object} The requested comment | |
| */ | |
| export function getSiteComment( state, siteId, commentId ) { | |
| const comments = getSiteComments( state, siteId ); | |
| return find( comments, { ID: commentId } ); | |
| } | |