Skip to content

Commit

Permalink
report LCP only if the value changes
Browse files Browse the repository at this point in the history
  • Loading branch information
monis0395 committed Dec 10, 2021
1 parent 6a51624 commit 789c51e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/getLCP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ export const getLCP = (onReport: ReportHandler, reportAllChanges?: boolean) => {
if (value < visibilityWatcher.firstHiddenTime) {
metric.value = value;
metric.entries.push(entry);
report();
}

report();
};

const po = observe('largest-contentful-paint', entryHandler);
Expand Down

0 comments on commit 789c51e

Please sign in to comment.