UNPKG

428 BJavaScriptView Raw
1"use strict";
2
3const {
4 join
5} = require(`path`);
6
7const {
8 fork
9} = require(`child_process`);
10
11module.exports = isTrackingEnabled => async () => {
12 if (!isTrackingEnabled) {
13 return;
14 } // Submit events on background w/o blocking the main process
15 // nor relying on it's lifecycle
16
17
18 const forked = fork(join(__dirname, `send.js`), {
19 detached: true,
20 stdio: `ignore`,
21 execArgv: []
22 });
23 forked.unref();
24};
\No newline at end of file