A VS Code extension providing helpful code snippets for quickly generating standard React Query (@tanstack/react-query) custom hooks used in Sanaap projects. This helps maintain consistency and speeds up development.
Features
This extension currently includes snippets for:
Standard Data-Fetching Hook (useQuery)
Standard Data-Mutation Hook (useMutation)
How to Use
Ensure this extension ("Sanaap RQ Hooks") is installed in your VS Code.
Open a .tsx or .ts file where you want to create a new hook.
Type one of the prefixes listed below for the desired snippet.
VS Code's IntelliSense will suggest the snippet. Select it and press Enter or Tab.
The snippet code will be inserted automatically.
Use the Tab key to jump between placeholders and fill in the required values for your specific API.
Available Snippets
Name
Prefixes
Description
Sanaap React Query Hook
rqhs, useQuerySanaap
Generates a useQuery hook for data fetching.
Sanaap React Mutation Hook
rqms, useMutationSanaap
Generates a useMutation hook for data mutation.
1. Sanaap React Query Hook
Prefixes:rqhs, useQuerySanaap
Description: Creates a comprehensive useQuery hook for fetching data from an API using standard Sanaap structure.
Placeholders to fill:
HookIdentifier: Your custom hook’s base name (e.g., AdminHospitalLog)
FeatureNameParams: The type for API parameters (e.g., LogHospitalExpenseParams)
FeatureNameResponse: The type for the API response (e.g., HospitalLogExpenseResponse)