feat: massive front-end overhaul and initial github release
This commit is contained in:
parent
a2b40e38bf
commit
d5a0e70580
303 changed files with 19840 additions and 676 deletions
24
src/mainview/query-options.ts
Normal file
24
src/mainview/query-options.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { keepPreviousData, queryOptions } from "@tanstack/react-query";
|
||||
import { getRomApiRomsIdGetOptions, getRomsApiRomsGetOptions } from "../clients/romm/@tanstack/react-query.gen";
|
||||
import { GameListFilter } from "./components/GameList";
|
||||
import { DefaultRommStaleTime } from "../shared/constants";
|
||||
|
||||
export function gamesQueryOptions (filter?: GameListFilter)
|
||||
{
|
||||
return queryOptions({
|
||||
...getRomsApiRomsGetOptions({ query: { order_by: "updated_at", platform_ids: filter?.platformIds, collection_id: filter?.collectionId } }),
|
||||
refetchOnWindowFocus: false,
|
||||
placeholderData: keepPreviousData,
|
||||
staleTime: DefaultRommStaleTime
|
||||
});
|
||||
}
|
||||
|
||||
export function gameQueryOptions (id: number)
|
||||
{
|
||||
return queryOptions({
|
||||
...getRomApiRomsIdGetOptions({ path: { id } }),
|
||||
refetchOnWindowFocus: false,
|
||||
placeholderData: keepPreviousData,
|
||||
staleTime: DefaultRommStaleTime
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue