From 0e0272ad282dbacbf40f90a3fa0d451f876c600a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=89=E7=9D=A1=E7=9A=84=E6=9C=A8=E6=9C=A8=E5=A4=95?= Date: Wed, 28 Feb 2024 14:28:19 +0800 Subject: [PATCH] Update 09_CombiningSequences.md (#2087) The description of a marble diagram was inconsistent with the diagram. (It had the labels `s1` and `s2` backwards.) --- Rx.NET/Documentation/IntroToRx/09_CombiningSequences.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rx.NET/Documentation/IntroToRx/09_CombiningSequences.md b/Rx.NET/Documentation/IntroToRx/09_CombiningSequences.md index 71b0ff7fa..19f5ab550 100644 --- a/Rx.NET/Documentation/IntroToRx/09_CombiningSequences.md +++ b/Rx.NET/Documentation/IntroToRx/09_CombiningSequences.md @@ -653,7 +653,7 @@ The marble diagram below shows off usage of `CombineLatest` with one sequence th ![A marble diagram showing three sequences. The first, s1, waits for a while then produces the values 1, 2, and 3, spaced out over time. The second, s2, starts at the same time as s1, and waits for less time, producing its first value, a, before s1 produces 1. Then after s1 has produced 2, s2 produces b and then c, both being produced before s1 produces 3. The third sequence, CombineLatest, shows '1,a' at the same time as s1 produces 1, then '2,a' when s1 produces 2, then '2,b' when s2 produces b, then '2,c' when s2 produces c, then '3,c' when s1 produces 3. All three sequences do not end within the time shown in the diagram.](GraphicsIntro/Ch09-CombiningSequences-Marbles-CombineLatest-Marbles.svg) -If we slowly walk through the above marble diagram, we first see that `s1` produces the letter 'a'. `s2` has not produced any value yet so there is nothing to pair, meaning that no value is produced for the result. Next, `s2` produces the number '1' so the result sequence can now produce a pair '1,a'. We then receive the number '2' from `s1`. The last letter is still 'a' so the next pair is '2,a'. The letter 'b' is then produced creating the pair '2,b', followed by 'c' giving '2,c'. Finally the number 3 is produced and we get the pair '3,c'. +If we slowly walk through the above marble diagram, we first see that `s2` produces the letter 'a'. `s1` has not produced any value yet so there is nothing to pair, meaning that no value is produced for the result. Next, `s1` produces the number '1' so the result sequence can now produce a pair '1,a'. We then receive the number '2' from `s1`. The last letter is still 'a' so the next pair is '2,a'. The letter 'b' is then produced creating the pair '2,b', followed by 'c' giving '2,c'. Finally the number 3 is produced and we get the pair '3,c'. This is great in case you need to evaluate some combination of state which needs to be kept up-to-date when any single component of that state changes. A simple example would be a monitoring system. Each service is represented by a sequence that returns a Boolean indicating the availability of said service. The monitoring status is green if all services are available; we can achieve this by having the result selector perform a logical AND. Here is an example. @@ -882,4 +882,4 @@ The `And`/`Then`/`When` trio has more overloads that enable you to group an even ## Summary -This chapter covered a set of methods that allow us to combine observable sequences. This brings us to a close on Part 2. We've looked at the operators that are mostly concerned with defining the computations we want to perform on the data. In Part 3 we will move onto practical concerns such as managing scheduling, side effects, and error handling. \ No newline at end of file +This chapter covered a set of methods that allow us to combine observable sequences. This brings us to a close on Part 2. We've looked at the operators that are mostly concerned with defining the computations we want to perform on the data. In Part 3 we will move onto practical concerns such as managing scheduling, side effects, and error handling.