---
url: >-
  https://lit-ui-router.dev/api/lit-ui-router-ssr/testing/functions/countRetained.md
---
[lit-ui-router-ssr](../../index.md) / [testing](../index.md) / countRetained

# Function: countRetained()

```ts
function countRetained(stamp): RetainedCount;
```

Defined in: [packages/lit-ui-router-ssr/src/testing.ts:62](https://github.com/simshanith/lit-ui-router/blob/3f55e419faf009567db729db221186a55d7675fe/packages/lit-ui-router-ssr/src/testing.ts#L62)

Counts which of the stamped elements are still under the stamp's root, and
how many elements arrived beside them. A view the client rendered over
instead of adopting counts its served elements as removed and its new ones
as added.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `stamp` | [`ServedStamp`](../interfaces/ServedStamp.md) |

## Returns

[`RetainedCount`](../interfaces/RetainedCount.md)
