Javatpoint Logo
Javatpoint Logo

RxJS merge() Join Operator

The RxJS merge() operator is a join operator that is used to turn multiple observables into a single observable. It creates an output Observable, which concurrently emits all values from every given input Observables.

In other words, we can say that the merge() operator includes the multiple Observables together by blending their values into one Observable.

Syntax:

Following is the syntax of the concat() operator:

Parameter Explanation

observable: It specifies that the input given will be an array of Observable.

Return value

The merge() operator's return value is a single observable that gives a single value as output, which includes every input Observable result.

Let us see some examples of merge() operator to understand it clearly.

Example 1 (Simple Example to Merge two lists)

Output:

After executing the above example, you will see the following result:

RxJS merge() Join Operator

In the above example, you can see that the merge() operator has included the both lists in one result as output.

Example 2 (Merging multiple observables using Static Method)

Output:

After executing the above example, you will see the following result:

RxJS merge() Join Operator

Example 3 (Merging 2 Observables using Instance Method)

Output:

After executing the above example, you will see the following result:

RxJS merge() Join Operator
Next TopicRxJS Operators




Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA