Skip to content

Commit 9dd5fd2

Browse files
authored
Merge pull request #197 from monis0395/lcp_report
Report LCP only if the value changes
2 parents 6a51624 + 789c51e commit 9dd5fd2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/getLCP.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ export const getLCP = (onReport: ReportHandler, reportAllChanges?: boolean) => {
4040
if (value < visibilityWatcher.firstHiddenTime) {
4141
metric.value = value;
4242
metric.entries.push(entry);
43+
report();
4344
}
44-
45-
report();
4645
};
4746

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

0 commit comments

Comments
 (0)