File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type { AppProps } from 'next/app';
22import { ThemeProvider } from 'next-themes' ;
33import { Analytics } from '@vercel/analytics/react' ;
44import { SpeedInsights } from '@vercel/speed-insights/next' ;
5+ import { SWRConfig } from 'swr' ;
56
67import { isProduction } from '@/lib/utils' ;
78
@@ -16,11 +17,19 @@ function MyApp({ Component, pageProps }: AppProps) {
1617 { isProduction ( ) && < GoogleAnalytics /> }
1718
1819 < ThemeProvider attribute = "class" >
19- < Layout >
20- < Component { ...pageProps } />
21- < SpeedInsights />
22- < Analytics />
23- </ Layout >
20+ < SWRConfig
21+ value = { {
22+ revalidateOnFocus : false ,
23+ revalidateOnReconnect : false ,
24+ dedupingInterval : 60000 , // 1 minute
25+ } }
26+ >
27+ < Layout >
28+ < Component { ...pageProps } />
29+ < SpeedInsights />
30+ < Analytics />
31+ </ Layout >
32+ </ SWRConfig >
2433 </ ThemeProvider >
2534 </ >
2635 ) ;
Original file line number Diff line number Diff line change 11import { NextApiRequest , NextApiResponse } from 'next' ;
22
33const GH_HEADERS = new Headers ( {
4- Authorization : `Bauer ${ process . env . GITHUB_TOKEN } ` ,
4+ Authorization : `Bearer ${ process . env . GITHUB_TOKEN } ` ,
55} ) ;
66
77const starReducer = ( acc : number , repo : { stargazers_count : number } ) => {
You can’t perform that action at this time.
0 commit comments