import {keepPreviousData, useQuery} from "@tanstack/react-query"; import type {RoleSearchParams} from "../../type/role.types.ts"; import {fetchRoleList} from "../../api/roleApi.ts"; export function useRoleList(searchParams: RoleSearchParams) { return useQuery({ queryKey: ['roleList', searchParams], queryFn: () => fetchRoleList(searchParams), placeholderData: keepPreviousData }); }