[Statsig] Track like/follow metadata (#3435)
* Track becoming mutuals * Track poster/liker status * Track post and followee clout * Track follower and liker clout * Extract utility
This commit is contained in:
parent
8188f61e7d
commit
887fedabea
4 changed files with 75 additions and 11 deletions
|
|
@ -43,6 +43,14 @@ export function attachRouteToLogEvents(
|
|||
getCurrentRouteName = getRouteName
|
||||
}
|
||||
|
||||
export function toClout(n: number | null | undefined): number | undefined {
|
||||
if (n == null) {
|
||||
return undefined
|
||||
} else {
|
||||
return Math.max(0, Math.round(Math.log(n)))
|
||||
}
|
||||
}
|
||||
|
||||
export function logEvent<E extends keyof LogEvents>(
|
||||
eventName: E & string,
|
||||
rawMetadata: LogEvents[E] & FlatJSONRecord,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue