# Evt.merge(\[ evt1, evt2, ... ])

Returns a new `Evt` instance which concurrently post all event data from every given input `Evt`.

## Return

A new `Evt` that has for type arguments the union of the type arguments of the inputs `Evt`.

## Parameters

`Ctx<any>` *Optional*, `Ctx` that will be used to detach the handler that has been attached to the input Evts.

`Evt<any>[]` Evts to be merged.

## Example

```typescript
import { Evt } from "evt";

const ctx= Evt.newCtx();

const evtText = new Evt<string>();
const evtTime = new Evt<number>();

//evtTextOrTime is Evt<string | number>, ctx is optional.
const evtTextOrTime= Evt.merge(ctx, [evtText, evtTime]);

evtTextOrTime.attach(console.log);

evtText.post("Foo bar"); //Prints "Foo bar"

ctx.done();

evtText.post("Foo bar"); //Prints nothing
```

[**Run the example**](https://stackblitz.com/edit/evt-nbshnc?embed=1\&file=index.ts\&hideExplorer=1)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.evt.land/api/evt/merge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
