[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user