Unverified Commit 659d2579 authored by MariaLazarova's avatar MariaLazarova Committed by GitHub
Browse files

spelling-check

parent 75b9dc26
...@@ -6,13 +6,13 @@ from different `Observables` and transform them into a single emission. ...@@ -6,13 +6,13 @@ from different `Observables` and transform them into a single emission.
The resulting value is an array with the last emitted value of all included Observables. The resulting value is an array with the last emitted value of all included Observables.
In this very exercise, we will utilize the `forkJoin` operator. In this very exercise, we will utilize the `forkJoin` operator.
On first sight it is a perfect match for combining HTTP Requests since it waits until all On first sight, it is a perfect match for combining HTTP Requests since it waits until all
combined operators `complete` before emitting a result. combined operators `complete` before emitting a result.
## Behavior ## Behavior
The below example showcases a very simple case using the `forkJoin` operator. The below example showcases a very simple case using the `forkJoin` operator.
We make use of the `of` creation function (passing a singe value), as its emission pattern is very similar to an HTTP request. We make use of the `of` creation function (passing a single value), as its emission pattern is very similar to an HTTP request.
It emits one single value and completes. It emits one single value and completes.
```Typescript ```Typescript
...@@ -41,8 +41,7 @@ _forkJoin error_ ...@@ -41,8 +41,7 @@ _forkJoin error_
## 💡 Gotcha(s)! ## 💡 Gotcha(s)!
As stated above, the `forkJoin` creation function waits until every source raises a `complete` event. After that it will return As stated above, the `forkJoin` creation function waits until every source raises a `complete` event. After that, it will return the very *last* value of each source. It suits perfectly fine when dealing with HTTP Requests since they `complete` on their own.
the very *last* value of each source. It suits perfectly fine when dealing with HTTP Requests since they `complete` on their own.
However, there are many situations where this behavior is unwanted. However, there are many situations where this behavior is unwanted.
This example shows how `forkJoin` only emits the last value after all sources `completed`. This example shows how `forkJoin` only emits the last value after all sources `completed`.
...@@ -50,7 +49,7 @@ As stated above, the `forkJoin` creation function waits until every source raise ...@@ -50,7 +49,7 @@ As stated above, the `forkJoin` creation function waits until every source raise
![forkJoin all complete last](./assets/images/Reactive-architecture-and-ux-patterns_angular_combination-operators-forkJoin-emit-all-last_michael-hladky.png) ![forkJoin all complete last](./assets/images/Reactive-architecture-and-ux-patterns_angular_combination-operators-forkJoin-emit-all-last_michael-hladky.png)
_forkJoin all complete last_ _forkJoin all complete last_
Here you can see how `forkJoin` will never emit any value, because `a$` does not `complete`. Here you can see how `forkJoin` will never emit any value because `a$` does not `complete`.
![forkJoin no emission if not all complete](./assets/images/Reactive-architecture-and-ux-patterns_angular_combination-operators-forkJoin-emit-after-all-complete_michael-hladky.png) ![forkJoin no emission if not all complete](./assets/images/Reactive-architecture-and-ux-patterns_angular_combination-operators-forkJoin-emit-after-all-complete_michael-hladky.png)
_forkJoin no emission if not all complete_ _forkJoin no emission if not all complete_
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment