function readGroupMembersWith
readGroupMembersWith<Extra>(
groupList: readonly Group[],
readMore: (groupIds: number[]) => Promise<Extra>,
activeOnly: boolean,
): Promise<{ members: Map<number, ListingWithCount[]>; more: Extra; }>

Read several groups' members together with one more thing about the SAME groups — their prices, their full membership, whatever the caller needs — in one round of reads. A page hydrating many packages would otherwise pay a pair of reads per package and eat the request's subrequest budget. activeOnly has the meaning getListingsByGroupIds gives it, and is spelled out at every call site — whether inactive members count is the caller's decision, never a default.

Type Parameters

Extra

Parameters

groupList: readonly Group[]
readMore: (groupIds: number[]) => Promise<Extra>
activeOnly: boolean

Return Type

Promise<{ members: Map<number, ListingWithCount[]>; more: Extra; }>

Usage

import { readGroupMembersWith } from "docs/database.ts";