perf(pr,issue): load the interactive create form data concurrently

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-18 18:59:59 +02:00
1 parent 517d164d8a
commit 9360f39cc8
7 files changed
+239 -38

No files matched your search

+5
View File
@@ -33,6 +33,11 @@ func pageOf[T any](items []T, limit, page int) ([]T, error) {
return items[start:min(start+limit, len(items))], nil
}
// loadTogether runs the loaders concurrently and returns their errors joined.
func loadTogether(loaders ...func() error) error {
return concurrently(len(loaders), func(i int) error { return loaders[i]() })
}
// listAll collects pages until the server returns an empty one.
func listAll[T any](fetch func(page int) ([]T, error)) ([]T, error) {
result := []T{}