Skip to content

Commit 0e7d7df

Browse files
committed
Clarify exercise 6.1
1 parent 3ae89e8 commit 0e7d7df

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/content/6/en/part6a.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,12 +756,11 @@ describe('unicafe reducer', () => {
756756

757757
**Implement the reducer and its tests.**
758758

759-
In the tests, make sure that the reducer is an <i>immutable function</i> with the <i>deep-freeze</i> library.
760-
Ensure that the provided first test passes, because Redux expects that the reducer returns the original state when it is called with a first parameter - which represents the previous <i>state</i> - with the value <i>undefined</i>.
759+
The provided first test should pass without any changes. Redux expects that the reducer returns the original state when it is called with a first parameter - which represents the previous <i>state</i> - with the value <i>undefined</i>.
761760

762761
Start by expanding the reducer so that both tests pass. After that, add the remaining tests for the different actions of the reducer and implement the corresponding functionality in the reducer.
763762

764-
A good model for the reducer is the [redux-notes](/en/part6/flux_architecture_and_redux#pure-functions-immutable) example above.
763+
In the tests, make sure that the reducer is an <i>immutable function</i> with the <i>deep-freeze</i> library. A good model for the reducer is the [redux-notes](/en/part6/flux_architecture_and_redux#pure-functions-immutable) example above.
765764

766765
#### 6.2: Unicafe Revisited, step2
767766

src/content/6/fi/osa6a.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,11 +749,11 @@ describe('unicafe reducer', () => {
749749

750750
**Toteuta reducer ja tee sille testit.**
751751

752-
Varmista testeissä <i>deep-freeze</i>-kirjaston avulla, että kyseessä on <i>puhdas funktio</i>. Huomaa, että valmiin ensimmäisen testin on syytä mennä läpi koska Redux olettaa, että reducer palauttaa järkevän alkutilan kun sitä kutsutaan siten että ensimmäinen parametri eli aiempaa tilaa edustava <i>state</i> on <i>undefined</i>.
752+
Valmiina olevan ensimmäisen testin pitäisi mennä suoraan läpi ilman muutoksia. Redux olettaa, että reducer palauttaa järkevän alkutilan kun sitä kutsutaan siten että ensimmäinen parametri eli aiempaa tilaa edustava <i>state</i> on <i>undefined</i>.
753753

754754
Aloita laajentamalla reduceria siten, että molemmat testeistä menevät läpi. Lisää tämän jälkeen loput testit reducerin eri actioneille ja toteuta niitä vastaava toiminnallisuus reduceriin.
755755

756-
Reducerin toteutuksessa kannattaa ottaa mallia yllä olevasta [Redux-muistiinpanot](/osa6/flux_arkkitehtuuri_ja_redux#puhtaat-funktiot-immutable)-esimerkistä.
756+
Varmista testeissä <i>deep-freeze</i>-kirjaston avulla, että kyseessä on <i>puhdas funktio</i>. Reducerin toteutuksessa kannattaa ottaa mallia yllä olevasta [Redux-muistiinpanot](/osa6/flux_arkkitehtuuri_ja_redux#puhtaat-funktiot-immutable)-esimerkistä.
757757

758758
#### 6.2: Unicafe revisited, step2
759759

0 commit comments

Comments
 (0)