# PgPubSub.on() method · @imqueue/pg-pubsub

Source: https://imqueue.org/api/pg-pubsub/latest/pg-pubsub.pgpubsub.on_6/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-pubsub 3.0.5 — generated reference, not hand-written

Sets `'reconnect'` event handler

**Signature:**

```typescript
on(event: 'reconnect', listener: typeof reconnect): this;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| event | 'reconnect' | `'reconnect'` — a reconnect attempt was made, with the attempt number |
| listener | typeof reconnect | handler invoked when a reconnect attempt was made, with the attempt number. |


**Returns:**

this

