@aller/blink-labrador
Advanced tools
Comparing version 8.24.5-alpha.0 to 8.24.6-alpha.0
@@ -207,28 +207,21 @@ "use strict"; | ||
var _this_1 = this; | ||
console.log('Initiating web vitals tracking'); | ||
(0, load_1.default)(function () { | ||
var vitalsTracker = new chrome_web_vitals_1.default(); | ||
console.log('Initiated web vitals tracking'); | ||
var timeoutDuration = 5000; | ||
window.setTimeout(function () { | ||
var webVitals = vitalsTracker.getAllMetrics(); | ||
console.log(webVitals); | ||
console.log(_this_1.blink.webVitals); | ||
var vitalsTracker = new chrome_web_vitals_1.default(); | ||
var timeoutDuration = 5000; | ||
var webVitals = vitalsTracker.getAllMetrics(); | ||
window.setTimeout(function () { | ||
if (webVitals) { | ||
_this_1.blink.webVitals({ webVitals: webVitals }); | ||
// start another measurement for sending with the hidden state | ||
webVitals = vitalsTracker.getAllMetrics(); | ||
} | ||
}, timeoutDuration); | ||
var visibilityChangeListener = function () { | ||
if (document.visibilityState === 'hidden') { | ||
if (webVitals) { | ||
_this_1.blink.webVitals({ webVitals: webVitals }); | ||
} | ||
}, timeoutDuration); | ||
var visibilityChangeListener = function () { | ||
if (document.visibilityState === 'hidden') { | ||
var webVitals = vitalsTracker.getAllMetrics(); | ||
console.log(webVitals); | ||
console.log(_this_1.blink.webVitals); | ||
if (webVitals) { | ||
_this_1.blink.webVitals({ webVitals: webVitals }); | ||
} | ||
document.removeEventListener('visibilitychange', visibilityChangeListener); | ||
} | ||
}; | ||
document.addEventListener('visibilitychange', visibilityChangeListener); | ||
}); | ||
document.removeEventListener('visibilitychange', visibilityChangeListener); | ||
} | ||
}; | ||
document.addEventListener('visibilitychange', visibilityChangeListener); | ||
}; | ||
@@ -235,0 +228,0 @@ /** |
{ | ||
"name": "@aller/blink-labrador", | ||
"version": "8.24.5-alpha.0", | ||
"version": "8.24.6-alpha.0", | ||
"description": "Library for using blink on Labrador", | ||
@@ -76,3 +76,3 @@ "main": "lib/main.js", | ||
"dependencies": { | ||
"@aller/blink": "^8.24.5-alpha.0", | ||
"@aller/blink": "^8.24.6-alpha.0", | ||
"@soldotno/aller-in-view": "^3.0.2", | ||
@@ -96,3 +96,3 @@ "react": "^16.11.0", | ||
}, | ||
"gitHead": "7f518cb1703a687cb50eeb329f4c839e59218285" | ||
"gitHead": "6b9669cbc0a0f6c2c11a5a0b71cfb354ca52195b" | ||
} |
Sorry, the diff of this file is not supported yet
468500
6316
Updated@aller/blink@^8.24.6-alpha.0