MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / nextFromChoiceCache

Function nextFromChoiceCache

cli/src/hooks/use-gravity-ad.ts:72–77  ·  view source on GitHub ↗
(ctrl: GravityController)

Source from the content-addressed store, hash-verified

70
71// Pure helper: get the next cached choice ad set
72function nextFromChoiceCache(ctrl: GravityController): AdResponse[] | null {
73 if (ctrl.choiceCache.length === 0) return null
74 const set = ctrl.choiceCache[ctrl.choiceCacheIndex % ctrl.choiceCache.length]!
75 ctrl.choiceCacheIndex = (ctrl.choiceCacheIndex + 1) % ctrl.choiceCache.length
76 return set
77}
78
79/**
80 * Hook for fetching and rotating Gravity ads.

Callers 1

useGravityAdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected