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

Function usePlusPreviewLog

packages/shared/src/hooks/usePlusPreviewLog.ts:8–30  ·  view source on GitHub ↗
(
  targetId: TargetId,
)

Source from the content-addressed store, hash-verified

6const previewExtra = { origin: 'preview' };
7
8export const usePlusPreviewLog = (
9 targetId: TargetId,
10): { logPreviewOpen: () => void; logPreviewAction: () => void } => {
11 const { logSubscriptionEvent } = usePlusSubscription();
12
13 return useMemo(
14 () => ({
15 logPreviewOpen: () =>
16 logSubscriptionEvent({
17 event_name: LogEvent.Impression,
18 target_id: targetId,
19 extra: previewExtra,
20 }),
21 logPreviewAction: () =>
22 logSubscriptionEvent({
23 event_name: LogEvent.UpgradeSubscription,
24 target_id: targetId,
25 extra: previewExtra,
26 }),
27 }),
28 [logSubscriptionEvent, targetId],
29 );
30};

Callers 3

PlusUserBadgeFunction · 0.90
HeaderPlusButtonFunction · 0.90
ProfilePanelSectionFunction · 0.90

Calls 1

usePlusSubscriptionFunction · 0.90

Tested by

no test coverage detected