# RoomClient: wake event

> The wake event of the RoomClient interface fires when the room wakes from sleep and the client holds its full state again.

The **`wake`** event of the [`RoomClient`](/docs/client/room-client) interface fires when the room wakes from sleep and the client holds its full state again.

## Syntax

```ts
addEventListener("wake", (event) => {})
```

## Event type

A plain `Event`, with no properties of its own.

## Description

`wake` follows a [`sleep` event](/docs/client/room-client/sleep-event). When it fires, [`asleep`](/docs/client/room-client/asleep) is `false`, and calls the client made while the room slept are answered, not failed. Prediction starts over.

It isn't an [`open` event](/docs/client/room-client/open-event), since the connection never dropped. A room that wakes after the connection dropped, as from hibernation, fires `open` instead.

## Examples

### Catching up after a wake

A board game shows whose turn it is once the room is back, since another player's move is often what woke it.

```ts
// turns.ts
import { connect, defineSchema, entity } from "@irtio/client";

const Board = entity("board", { turn: "string" });
const schema = defineSchema({ state: Board });

const room = await connect("https://rooms.irt.io/my-game/chess-12", { schema });
const banner = document.querySelector("#turn")!;

room.addEventListener("wake", () => {
  banner.textContent = room.state.turn === room.player ? "Your move" : "Waiting for your opponent";
});
```

## See also

- [`sleep` event](/docs/client/room-client/sleep-event)
- [`RoomClient.asleep`](/docs/client/room-client/asleep)
- [`RoomDefinition.onWake()`](/docs/room/room-definition/onwake), the room side
- [Sleeping rooms](/docs/room/guides/hibernation#sleeping-rooms)
