From b88bcd49fdea0955f2efc8f09a3614c188d22107 Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Tue, 6 Jan 2026 08:18:17 -0600 Subject: fix(app): code splitting for web load perf gains --- packages/ui/src/hooks/use-filtered-list.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'packages/ui/src/hooks') diff --git a/packages/ui/src/hooks/use-filtered-list.tsx b/packages/ui/src/hooks/use-filtered-list.tsx index 416f030ef..94099d786 100644 --- a/packages/ui/src/hooks/use-filtered-list.tsx +++ b/packages/ui/src/hooks/use-filtered-list.tsx @@ -18,6 +18,9 @@ export interface FilteredListProps { export function useFilteredList(props: FilteredListProps) { const [store, setStore] = createStore<{ filter: string }>({ filter: "" }) + type Group = { category: string; items: [T, ...T[]] } + const empty: Group[] = [] + const [grouped, { refetch }] = createResource( () => ({ filter: store.filter, @@ -42,11 +45,12 @@ export function useFilteredList(props: FilteredListProps) { ) return result }, + { initialValue: empty }, ) const flat = createMemo(() => { return pipe( - grouped() || [], + grouped.latest || [], flatMap((x) => x.items), ) }) -- cgit v1.2.3