Skip to content

Commit

Permalink
Merge pull request #40 from Financial-Times/add-ready-state-dependency
Browse files Browse the repository at this point in the history
Add ready-state dependency
  • Loading branch information
andygout authored Feb 4, 2020
2 parents bfb23d4 + 0ebea16 commit 5aa505b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@financial-times/o-tracking": "^2.0.3",
"@financial-times/o-viewport": "^4.0.0",
"perfume.js": "^4.6.0",
"ready-state": "^2.0.5",
"seed-random": "^2.2.0"
},
"peerDependencies": {
Expand Down
15 changes: 0 additions & 15 deletions src/client/trackers/real-user-performance/documentReady.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/client/trackers/realUserMonitoringForPerformance.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Perfume from 'perfume.js';
import readyState from 'ready-state';
import { broadcast } from '../broadcast';
import { seedIsInSample } from '../utils/seedIsInSample';
import { getSpoorId } from '../utils/getSpoorId';
import { documentReady } from './real-user-performance/documentReady';

// @see "Important metrics to measure" https://web.dev/metrics
const requiredMetrics = [
Expand Down Expand Up @@ -39,7 +39,7 @@ export const realUserMonitoringForPerformance = () => {

const context = {};

documentReady.then(() => {
readyState.complete.then(() => {
// <https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/domInteractive>
context.domInteractive = Math.round(navigation.domInteractive);
// <https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/domComplete>
Expand Down

0 comments on commit 5aa505b

Please sign in to comment.