Download wp-calypso/client/dashboard/app/command-palette/utils.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 354 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/app/command-palette/utils.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/dashboard/app/command-palette/utils.ts
-
curl -L -o utils.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/app/command-palette/utils.ts
354 Bytes
| // @ts-expect-error The commands package is not yet typed. | |
| import { store as commandsStore } from '@wordpress/commands'; | |
| import { useDispatch } from '@wordpress/data'; | |
| /** | |
| * Utility function to open the command palette directly from anywhere | |
| */ | |
| export function useOpenCommandPalette() { | |
| const { open } = useDispatch( commandsStore ); | |
| return open; | |
| } | |