Download wp-calypso/client/post-editor/media-modal/preload-image.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 238 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/post-editor/media-modal/preload-image.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/post-editor/media-modal/preload-image.js
-
curl -L -o preload-image.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/post-editor/media-modal/preload-image.js
238 Bytes
| import { memoize } from 'lodash'; | |
| export default memoize( function ( src ) { | |
| // This is a non-standard use of the Lodash memoize helper, used here to | |
| // prevent multiple preloads for the same image. | |
| new window.Image().src = src; | |
| } ); | |