[API reference](https://evolu.dev/docs/api-reference) › [@evolu/web](https://evolu.dev/docs/api-reference/web) › createMessageChannel

```ts
function createMessageChannel<Input, Output>(): MessageChannel<Input, Output>;
```

Defined in: [Worker.ts:42](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/web/src/Worker.ts#L42)

Creates a [MessageChannel](https://evolu.dev/docs/api-reference/common/Worker/interfaces/MessageChannel) from a Web MessageChannel.

### Example

```ts
const channel = createMessageChannel<Request, Response>();
channel.port1.onMessage = (response) => console.log(response);
channel.port1.postMessage({ type: "ping" });
```