MCPcopy Create free account
hub / github.com/MagicCube/agentara / useTasks

Function useTasks

web/src/lib/api/hooks.ts:92–101  ·  view source on GitHub ↗
(options?: { refreshInterval?: number })

Source from the content-addressed store, hash-verified

90 * @param options.refreshInterval - If set, refetches at this interval (ms) while the query is active.
91 */
92export function useTasks(options?: { refreshInterval?: number }) {
93 return useQuery({
94 queryKey: ["tasks"],
95 queryFn: () =>
96 api.tasks.$get().then((res) => res.json() as Promise<Task[]>),
97 ...(options?.refreshInterval != null && {
98 refetchInterval: options.refreshInterval,
99 }),
100 });
101}
102
103/**
104 * Deletes a task by ID.

Callers 1

TasksPageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected