From 054ae4557d81686e93f25be453618bbbb3d5c5b2 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Sun, 12 Nov 2023 22:51:42 +1300 Subject: [PATCH] Make page size bigger (15->50) and fetch next page earlier This project is a little bit slow to get the pages, so it makes sense to fetch things earlier and to get them in bigger chunks. --- SetList.tsx | 1 + constants.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SetList.tsx b/SetList.tsx index dde6219..b69c750 100644 --- a/SetList.tsx +++ b/SetList.tsx @@ -148,6 +148,7 @@ export default function SetList() { style={{ flex: 1 }} renderItem={renderItem} onEndReached={next} + onEndReachedThreshold={0.99} refreshing={refreshing} keyExtractor={(set) => set.id?.toString()} onRefresh={() => { diff --git a/constants.ts b/constants.ts index a1c44b1..e3ad88a 100644 --- a/constants.ts +++ b/constants.ts @@ -3,4 +3,4 @@ export const PADDING = 10; export const ITEM_PADDING = 8; export const DARK_RIPPLE = "#444444"; export const LIGHT_RIPPLE = "#c2c2c2"; -export const LIMIT = 15; +export const LIMIT = 50;