Skip to content

Commit

Permalink
Use onXXX method names from web-vitals
Browse files Browse the repository at this point in the history
  • Loading branch information
akunzai committed Jul 7, 2023
1 parent bba803c commit 54a03dd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions samples/AspNetCoreReactSample/ClientApp/src/reportWebVitals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { ReportCallback } from 'web-vitals';

const reportWebVitals = (onPerfEntry?: ReportCallback) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
import('web-vitals').then(({ onCLS, onFID, onFCP, onLCP, onTTFB }) => {
onCLS(onPerfEntry);
onFID(onPerfEntry);
onFCP(onPerfEntry);
onLCP(onPerfEntry);
onTTFB(onPerfEntry);
});
}
};
Expand Down

0 comments on commit 54a03dd

Please sign in to comment.