Remote / foldkit-remote/filter

filtered

function · packages/remote/src/filter.ts:55

function filtered<
  Domain extends AnyDomain,
  Value,
  Name extends string,
  Input,
  Q extends QueryDescriptor<any, any, any>,
>(
  domain: Domain,
  model: ModelOfDomain<Domain>,
  over: QueryProjection<ModelOfDomain<Domain>, Value, Name, Input>,
  by: Q & Registered<Q['name'], QueryNames<Domain>, 'Query'>,
  input: QueryInput<Q>,
): Matched<Value>

The rows of a loaded list that a body matches, decoded as the list decodes them — a filter that asks the server nothing.

It filters a list; it does not run a query. That distinction is what keeps it honest. "Which rows match" would need to know that the list holds every row the body could match, which is predicate containment and is deliberately not built. "Which rows of this list match" is decidable from what is already here, and is what a search box over a loaded page actually wants.

complete says whether the answer is about the whole list: every edge judged, and the connection terminal at both ends. An incomplete answer is not wrong — it is about less than the caller may have meant, which is why it is said rather than left for a view to assume.

Creates no connection, so there is nothing new to retain and nothing new to fetch. The server stays authoritative for which rows exist.