Download wp-calypso/client/lib/analytics/with-tracking-tool/index.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 524 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/with-tracking-tool/index.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/analytics/with-tracking-tool/index.jsx
-
curl -L -o index.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/with-tracking-tool/index.jsx
524 Bytes
| import { createHigherOrderComponent } from '@wordpress/compose'; | |
| import { useEffect } from 'react'; | |
| import { useDispatch } from 'react-redux'; | |
| import { loadTrackingTool } from 'calypso/state/analytics/actions'; | |
| export default ( trackingTool ) => | |
| createHigherOrderComponent( | |
| ( EnhancedComponent ) => ( props ) => { | |
| const dispatch = useDispatch(); | |
| useEffect( () => { | |
| dispatch( loadTrackingTool( trackingTool ) ); | |
| }, [ dispatch ] ); | |
| return <EnhancedComponent { ...props } />; | |
| }, | |
| 'WithTrackingTool' | |
| ); | |