<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [rc-js-util](./rc-js-util.md) &gt; [ReferenceCounter](./rc-js-util.referencecounter.md) &gt; [(constructor)](./rc-js-util.referencecounter._constructor_.md)

## ReferenceCounter.(constructor)

Constructs a new instance of the `ReferenceCounter` class

**Signature:**

```typescript
constructor(onZeroReference?: (key: TKey) => void);
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

onZeroReference


</td><td>

(key: TKey) =&gt; void


</td><td>

_(Optional)_


</td></tr>
</tbody></table>
