[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:81](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/web/src/Worker.ts#L81)

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" });
```