Skip to content

Instantly share code, notes, and snippets.

@pranitkhadilkar7
Created March 27, 2024 13:48
Show Gist options
  • Save pranitkhadilkar7/74c7585cc884599440609d764db33420 to your computer and use it in GitHub Desktop.
Save pranitkhadilkar7/74c7585cc884599440609d764db33420 to your computer and use it in GitHub Desktop.
src/pages/home/home-service.ts file for RTK Query endpoints specific to home page
import { applicationApi } from '../../store/service'
import { LatestRelease } from './home-type'
const homeService = applicationApi.injectEndpoints({
endpoints: (build) => ({
getLatestRelease: build.query<LatestRelease, void>({
query: () => ({
url: '/release/latest',
method: 'GET',
}),
}),
}),
})
export const { useGetLatestReleaseQuery } = homeService
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment