Skip to content

Commit 7b569f3

Browse files
committed
feat(analytics): make more structured event types and utils for events
1 parent 797a7ba commit 7b569f3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

analytics/events.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"use strict";
2+
3+
const makeEvent = (category) => (eventDetails) => ({
4+
category: category,
5+
action: eventDetails.action,
6+
label: eventDetails.label || undefined,
7+
value: eventDetails.value || undefined
8+
});
9+
10+
const buildEvent = makeEvent("build");
11+
const configEvent = makeEvent("options");
12+
13+
exports.makeEvent = makeEvent;
14+
exports.buildEvent = buildEvent;
15+
exports.configEvent = configEvent;

0 commit comments

Comments
 (0)