[API reference](https://evolu.dev/docs/api-reference) › [@evolu/vue](https://evolu.dev/docs/api-reference/vue) › waitForRows

```ts
function waitForRows(
  ...rows: readonly Readonly<Ref<QueryRows, QueryRows>>[]
): Promise<void>;
```

Defined in: [useQuery.ts:158](https://github.com/evoluhq/evolu/blob/aa223771feea747ffb1b0f5f3271574455633e37/packages/vue/src/useQuery.ts#L158)

Waits for the first load of each query whose rows [useQuery](https://evolu.dev/docs/api-reference/vue/functions/useQuery),
[useQueries](https://evolu.dev/docs/api-reference/vue/functions/useQueries), [useDeviceQuery](https://evolu.dev/docs/api-reference/vue/functions/useDeviceQuery), or [useDeviceQueries](https://evolu.dev/docs/api-reference/vue/functions/useDeviceQueries)
returned, so an async setup under `<Suspense>` renders once they loaded, and
`<Suspense>` shows its fallback meanwhile. Call the composables before
awaiting it, because a composable can't run after an `await` in `setup()`.

It rejects with the [UnknownError](https://evolu.dev/docs/api-reference/common/Error/variables/UnknownError) of the first load SQLite fails, so
the error reaches `onErrorCaptured` of a component above, and it's not also
reported as an unhandled rejection. A later refresh, also one SQLite fails,
changes nothing it waited for. It stays pending for rows of an instance whose
database's deletion, or its AppOwner's removal, disposed it, as React's
`useQuery` stays suspended until the app replaces the instance, and while a
refused database answers no load, until the instance's disposal resolves the
load with no rows. Observe [EvoluErrorDep.evoluError](https://evolu.dev/docs/api-reference/common/local-first/Evolu/interfaces/EvoluErrorDep#evoluerror) to show the
refusal. Rows that none of these composables returned are a defect, so it
throws.

### Example

```ts
import {
  assertType,
  createQueryBuilder,
  testEvoluSchema,
  type QueryRows,
} from "@evolu/common";
import { useQueries, useQuery, waitForRows } from "@evolu/vue";
import type { Ref } from "vue";

const createQuery = createQueryBuilder(testEvoluSchema);
const allTodos = createQuery((db) => db.selectFrom("todo").selectAll());
const allProjects = createQuery((db) => db.selectFrom("project").selectAll());

// An async setup of a component under <Suspense>.
const setup = async () => {
  // oxlint-disable-next-line react/rules-of-hooks -- Composables run before the await.
  const todos = useQuery(allTodos);
  // oxlint-disable-next-line react/rules-of-hooks -- Composables run before the await.
  const [projects] = useQueries([allProjects]);
  // A failure reaches onErrorCaptured of a component above.
  await waitForRows(todos, projects);
  return { todos, projects };
};

assertType<
  Awaited<ReturnType<typeof setup>>["todos"],
  Readonly<Ref<QueryRows<typeof allTodos.Row>>>
>();
```