From d53d375d09dd86a85ffb249de1c0cc7c3b3438bc Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 4 Jan 2022 13:35:25 +0100
Subject: refactor: avoid useless assignement before return statement

---
 src/pages/blog/index.tsx | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

(limited to 'src/pages/blog/index.tsx')

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(
-- 
cgit v1.2.3

