Download wp-calypso/client/data/application-passwords/use-app-passwords-query.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 379 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/data/application-passwords/use-app-passwords-query.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/data/application-passwords/use-app-passwords-query.js
-
curl -L -o use-app-passwords-query.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/data/application-passwords/use-app-passwords-query.js
379 Bytes
| import { useQuery } from '@tanstack/react-query'; | |
| import wp from 'calypso/lib/wp'; | |
| const useAppPasswordsQuery = () => | |
| useQuery( { | |
| queryKey: [ 'application-passwords' ], | |
| queryFn: () => wp.req.get( '/me/two-step/application-passwords' ), | |
| refetchOnWindowFocus: false, | |
| select( data ) { | |
| return data.application_passwords; | |
| }, | |
| } ); | |
| export default useAppPasswordsQuery; | |