# RoomClient: update property

> The update read-only property of the RoomClient interface is the update number of the last state update the client applied.

The **`update`** read-only property of the [`RoomClient`](/docs/client/room-client) interface is the update number of the last state update the client applied.

## Value

A number. It's `0` before the first state update.

## Description

The room numbers the state updates it sends. When the client reconnects to the same [`generation`](/docs/client/room-client/generation) of the room, it sends `update` so the room resumes from there and sends only what changed since.

The [`update` event](/docs/client/room-client/update-event) fires after each state update with the same number, and [`stats.lastUpdate`](/docs/client/wire-stats/lastupdate) gives that update's size. In a room without ticks, where [`tick`](/docs/client/room-client/tick) is `0`, `update` is what counts the client's view.

## Examples

### Logging updates in a debug overlay

A debug overlay logs each state update's number, tick and size as it's applied.

```ts
// updates.ts
import type { RoomClient } from "@irtio/client";

export function logUpdates(room: RoomClient): void {
  room.addEventListener("update", () => {
    const size = room.stats.lastUpdate?.bytes ?? 0;
    console.log(`update ${room.update} at tick ${room.tick}, ${size} bytes`);
  });
}
```

## See also

- [`update` event](/docs/client/room-client/update-event)
- [`RoomClient.tick`](/docs/client/room-client/tick)
- [`WireStats`](/docs/client/wire-stats)
