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

Function dedupeEvents

desktop/src/features/home/useInboxThreadContext.ts:18–24  ·  view source on GitHub ↗
(events: RelayEvent[])

Source from the content-addressed store, hash-verified

16const THREAD_CONTEXT_LIMIT = 100;
17
18function dedupeEvents(events: RelayEvent[]): RelayEvent[] {
19 const eventsById = new Map<string, RelayEvent>();
20 for (const event of events) {
21 eventsById.set(event.id, event);
22 }
23 return [...eventsById.values()].sort((a, b) => a.created_at - b.created_at);
24}
25
26function getThreadRootId(event: RelayEvent): string {
27 const thread = getThreadReference(event.tags);

Callers 2

loadContextFunction · 0.85
useInboxThreadContextFunction · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected