fix(app): code splitting for web load perf gains

This commit is contained in:
Adam 2026-01-06 08:18:17 -06:00
commit b88bcd49fd
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
9 changed files with 151 additions and 84 deletions

View file

@ -18,6 +18,9 @@ export interface FilteredListProps<T> {
export function useFilteredList<T>(props: FilteredListProps<T>) {
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<T>(props: FilteredListProps<T>) {
)
return result
},
{ initialValue: empty },
)
const flat = createMemo(() => {
return pipe(
grouped() || [],
grouped.latest || [],
flatMap((x) => x.items),
)
})