Download wp-calypso/client/lib/detect-history-navigation/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 297 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/detect-history-navigation/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/detect-history-navigation/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/detect-history-navigation/index.js
297 Bytes
| let _loadedViaHistory = false; | |
| export default { | |
| start: function () { | |
| // add a popstate listener that sets the flag | |
| window.addEventListener( 'popstate', function ( event ) { | |
| _loadedViaHistory = !! event.state; | |
| } ); | |
| }, | |
| loadedViaHistory: function () { | |
| return _loadedViaHistory; | |
| }, | |
| }; | |