MCPcopy Create free account
hub / github.com/dailydotdev/apps / readStreakViewQueue

Function readStreakViewQueue

packages/shared/src/lib/streakViewQueue.ts:19–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17);
18
19export const readStreakViewQueue = (): QueuedStreakView[] => {
20 try {
21 const raw = storageWrapper.getItem(STREAK_VIEW_QUEUE_KEY);
22 const parsed = raw ? JSON.parse(raw) : [];
23
24 if (!Array.isArray(parsed)) {
25 return [];
26 }
27
28 return parsed.filter(
29 (item): item is QueuedStreakView =>
30 !!item &&
31 typeof item.postId === 'string' &&
32 typeof item.userId === 'string' &&
33 typeof item.at === 'number',
34 );
35 } catch {
36 return [];
37 }
38};
39
40const writeStreakViewQueue = (queue: QueuedStreakView[]): void => {
41 try {

Callers 5

enqueueStreakViewFunction · 0.85
removeStreakViewFunction · 0.85
drainStreakViewQueueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected