Download wp-calypso/apps/odyssey-stats/src/widget-loader.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 570 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/odyssey-stats/src/widget-loader.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/apps/odyssey-stats/src/widget-loader.ts
-
curl -L -o widget-loader.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/odyssey-stats/src/widget-loader.ts
570 Bytes
| /** | |
| * The loader is to optimize page loading time of WP-Admin Dashboard. | |
| */ | |
| // `init-widget-config` has to be the first import, because there could be packages that reference it in their side effect. | |
| import './lib/init-widget-config'; | |
| // Initialize Stats widget when DOMContentLoaded is fired, or immediately if it already has been. | |
| function initStatsWidget() { | |
| return import( './widget' ).then( ( { init } ) => init() ); | |
| } | |
| if ( document.readyState !== 'loading' ) { | |
| initStatsWidget(); | |
| } else { | |
| document.addEventListener( 'DOMContentLoaded', initStatsWidget ); | |
| } | |