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

Function drainStreakViewQueue

packages/shared/src/lib/streakViewQueue.ts:145–154  ·  view source on GitHub ↗
({
  userId,
  sendView,
  now = new Date(),
}: DrainStreakViewQueueProps)

Source from the content-addressed store, hash-verified

143// Replays the views queued for this user, oldest first, and resolves with how
144// many the API accepted.
145export const drainStreakViewQueue = ({
146 userId,
147 sendView,
148 now = new Date(),
149}: DrainStreakViewQueueProps): Promise<number> =>
150 sendQueuedViews(
151 readStreakViewQueue().filter((view) => view.userId === userId),
152 sendView,
153 now,
154 );

Callers 1

drainFunction · 0.90

Calls 2

sendQueuedViewsFunction · 0.85
readStreakViewQueueFunction · 0.85

Tested by

no test coverage detected