MCPcopy Create free account
hub / github.com/agent-tower/core / useTasks

Function useTasks

packages/web/src/hooks/use-tasks.ts:99–114  ·  view source on GitHub ↗
(projectId: string, options?: ListTasksParams)

Source from the content-addressed store, hash-verified

97 const params = queryKey[2]
98 if (!params || typeof params !== 'object') return true
99 const boardProjectId = (params as { projectId?: unknown }).projectId
100 return boardProjectId == null || boardProjectId === projectId
101}
102
103export function removeTaskFromBoardCaches(
104 queryClient: QueryClient,
105 taskId: string,
106 projectId?: string,
107): TaskBoardSnapshot {
108 const predicate = (query: { queryKey: QueryKey }) => isTaskBoardQueryKey(query.queryKey, projectId)
109 const snapshots = queryClient.getQueriesData<TaskBoardResponse>({ predicate })
110
111 queryClient.setQueriesData<TaskBoardResponse>({ predicate }, (current) => {
112 if (!current || !Array.isArray(current.data)) return current
113 const nextData = current.data.filter((task) => task.id !== taskId)
114 if (nextData.length === current.data.length) return current
115 return {
116 ...current,
117 data: nextData,

Callers 1

ProjectKanbanPageFunction · 0.90

Calls 2

listMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected