MCPcopy Create free account
hub / github.com/block/buzz / fetchProjects

Function fetchProjects

desktop/src/features/projects/hooks.ts:214–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

212}
213
214async function fetchProjects(): Promise<Project[]> {
215 const [events, deletionEvents] = await Promise.all([
216 relayClient.fetchEvents({
217 kinds: [KIND_REPO_ANNOUNCEMENT],
218 limit: 200,
219 }),
220 relayClient.fetchEvents({
221 kinds: [KIND_DELETION],
222 limit: 500,
223 }),
224 ]);
225
226 return dedup(events)
227 .map(eventToProject)
228 .filter(
229 (project) =>
230 !isHiddenLocally(project) && !isDeletedByA(project, deletionEvents),
231 )
232 .sort((a, b) => b.createdAt - a.createdAt);
233}
234
235/**
236 * Splits a project route ID into its owner pubkey and dtag. The canonical

Callers

nothing calls this directly

Calls 4

isHiddenLocallyFunction · 0.85
isDeletedByAFunction · 0.85
dedupFunction · 0.70
fetchEventsMethod · 0.45

Tested by

no test coverage detected