Skip to content

Instantly share code, notes, and snippets.

@jimkeller
Created September 29, 2022 01:55
Show Gist options
  • Save jimkeller/1c0e05d8464f0146f823be24f072517f to your computer and use it in GitHub Desktop.
Save jimkeller/1c0e05d8464f0146f823be24f072517f to your computer and use it in GitHub Desktop.
EmployeeSearchForm using depdendency-injected service
function EmployeeSearchForm() {
const employee_data_client = useEmployeeDataClient();
const loadResults = async(employee_id) => {
return await employee_data_client.getResults(employee_id);
}
/* Below here, the rest of the component; e.g. rendering a form that calls
loadResults */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment