1
votes

I like the readability provided by

observable
  .pipe(operator1)
  .pipe(operator2)
  .pipe(operator3)
  .subscribe()

And it reminds me of a chain of thens for a promise.

But I know this is in every documentation example

observable
  .pipe(
    operator1,
    operator2,
    operator3
).subscribe()

Is there something lost in doing the first thing over the second? I am probably missing some crucial information here and maybe it's very obvious, actually. Thanks for the help.

1
What do you mean lost? The first example runs more code because you execute pipe multiple times. The outcome is the same. - frido

1 Answers

0
votes

certainly they are equal and they have same result.

both of them is equal to

operator3(operator2(operator1(observable))).subscribe()