flatMap, mergeMap, switchMap and concatMap in rxjs?

Discussão em 'Angular' iniciado por xkeshav, Novembro 14, 2024.

  1. xkeshav

    xkeshav Guest

    Someone, please explain the difference between SwitchMap and FlatMap in terms of Javascript ( in angular perspective, rxjs 5)

    In my understanding.

    SwitchMap only emits the latest observable value and cancels the previous observable.

    flatMap collects all individual observables and returns all observables in a single array without caring about the order of observable. works asynchronously.

    concatMap preserve the order and emits all observable value, works synchronously

    is that right?

    how does mergeMap works differently from above?

    someone, please explain with an example.

    Continue reading...

Compartilhe esta Página