diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-04 13:35:25 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-04 13:35:25 +0100 |
| commit | d53d375d09dd86a85ffb249de1c0cc7c3b3438bc (patch) | |
| tree | 827e02f739a542e674e5d447f46ee97096f02cd7 /src/pages/blog/index.tsx | |
| parent | ab5e5f4bdf40b5bc1ccf82dc1b4aca94d5171ec3 (diff) | |
refactor: avoid useless assignement before return statement
Diffstat (limited to 'src/pages/blog/index.tsx')
| -rw-r--r-- | src/pages/blog/index.tsx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/pages/blog/index.tsx b/src/pages/blog/index.tsx index a638bd4..095af72 100644 --- a/src/pages/blog/index.tsx +++ b/src/pages/blog/index.tsx @@ -16,15 +16,12 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ fallback }) => { const getKey = (pageIndex: number, previousData: PostsListData) => { if (previousData && !previousData.posts) return null; - const args = - pageIndex === 0 - ? { first: config.postsPerPage } - : { - first: config.postsPerPage, - after: previousData.pageInfo.endCursor, - }; - - return args; + return pageIndex === 0 + ? { first: config.postsPerPage } + : { + first: config.postsPerPage, + after: previousData.pageInfo.endCursor, + }; }; const { data, error, size, setSize } = useSWRInfinite( |
