You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
"description":"create your first store and call it `store`. Use a simple\"reducer\" function for now, let's say `state => state`.",
22
34
"hints": [
23
-
"\"pokemon/index.js\" should have `const VOTE_UP = 'VOTE_UP';`"
35
+
"declare your store, `const store`",
36
+
"call store with a simple reducer, `const store = createStore(state => state)`"
37
+
],
38
+
"tests": [
39
+
"02/03"
24
40
]
25
41
},
26
42
{
27
-
"description":"take your`voteUp` action creator from\"index.js\"andput it in\"pokemon/index.js\". Export it as a [\"named\" export](https://developer.mozilla.org/en/docs/web/javascript/reference/statements/export).",
43
+
"description":"log yourstore to the consoleandhave a look.",
28
44
"tests": [
29
-
"07/03"
45
+
"02/04"
30
46
],
31
47
"hints": [
32
-
"move `voteUp` into\"pokemon/index.js\"",
33
-
"\"pokemon/index.js\" should have `const voteUp = id => ({ type: VOTE_UP, payload: { id } });`"
48
+
"console.log(store)"
34
49
]
35
50
},
36
51
{
37
-
"description":"take your `pokemon` reducer from\"index.js\" and put it in\"pokemon/index.js\". Exportthereducer as a\"default\" export",
"description":"in your\"index.js\" file, import theaction creatorsandreducerinone line of code.",
61
+
"description":"move the initial state to thetop of the file,andpass itinas a second param your `createStore`",
44
62
"tests": [
45
-
"07/05"
63
+
"02/06"
46
64
],
47
65
"hints": [
48
-
"Try this: `import { default as pokemon, voteUp } from './pokemon';`"
66
+
"Move `initialState` above your `store`",
67
+
"Pass in `initialState` as a second param to `createStore`"
68
+
],
69
+
"actions": [
70
+
"insert('const initialState = {\n pokemon: [{\n id: 1,\n name: 'Luvdisc',\n description: 'This heart-shaped POKéMON earned its name by swimming after loving couples it spotted in the ocean’s waves.',\n votes: 3\n }, {\n id: 2,\n name: 'Trubbish',\n description: 'Wanting more garbage, they follow people who litter. They always belch poison gas.',\n votes: 2\n }, {\n id: 3,\n name: 'Stunfisk',\n description: 'Its skin is very hard, so it is unhurt even if stepped on by sumo wrestlers. It smiles when transmitting electricity.',\n votes: 0\n }]\n };\n')"
49
71
]
50
72
}
51
73
],
52
-
"onPageComplete":""
74
+
"onPageComplete":"As you can see, the store is just an object with various methods like\"dispatch\" and\"getState\". Let's see what these methods do in the next step."