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

Function useFetchAd

packages/shared/src/features/monetization/useFetchAd.ts:18–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16}
17
18export const useFetchAd = (): UseFetchAds => {
19 const boostsEnabled = useFeature(featurePostBoostAds);
20
21 const fetchAdQuery: UseFetchAds['fetchAd'] = useCallback(
22 ({ active, placement = AdPlacement.Feed }) => {
23 return fetchAdByPlacement(
24 resolveAdFetchOptions({
25 placement,
26 active,
27 boostsEnabled,
28 }),
29 );
30 },
31 [boostsEnabled],
32 );
33
34 return {
35 fetchAd: fetchAdQuery,
36 };
37};

Callers 2

useFeedFunction · 0.90
useAutoRotatingAdsFunction · 0.90

Calls 3

useFeatureFunction · 0.90
fetchAdByPlacementFunction · 0.90
resolveAdFetchOptionsFunction · 0.90

Tested by

no test coverage detected