The concat
function in the rxjs
library is used to merge multiple observables in a sequential manner.
Here's an example of how to use the concat
function:
349 chars14 lines
In this example, we create three observables using the of
function, which emits the values 'hello', 'world!', and 'rxjs' respectively. We then pass these observables as arguments to the concat
function to merge them in a sequential manner.
Finally, we subscribe to the concatenated observable and log the emitted values to the console.
Note that the concat
function will wait for each observable to complete before moving on to the next one. If an observable never completes, then the concat
function will never move on to the next observable.
gistlibby LogSnag