Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
12345678910111213141516171819202122232425262728import { queryOptions, useQuery } from "@octanejs/tanstack-query";import type { InstructionSettings } from "../../../shared/instructions";import type { CustomerQuerySession } from "../customer-query-session";import { useCustomerQuerySession } from "../customer-query-provider";import { callOwner, type SettingsConnection } from "../owner-rpc";
export function instructionOptions( session: CustomerQuerySession, connection: SettingsConnection,) { return queryOptions({ queryKey: session.key("settings", "instructions"), enabled: !!session.getSnapshot().scope && !!connection?.isReady(), queryFn: ({ signal }) => callOwner<InstructionSettings>( connection, "getInstructionSettings", [], signal, ), });}
export function useInstructionsQuery(connection: SettingsConnection) { const session = useCustomerQuerySession(); return useQuery(instructionOptions(session, connection));}