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
<li><ahref="#step4">Step 4: Create the Actions</a></li>
9
+
<li><ahref="#step5">Step 5: Create the Reducer</a></li>
10
+
</ul>
11
+
12
+
### FOLLOW Step 1 to 3 in <ahref="https://github.com/MosesEsan/mesan-react-native-hooks-redux-boilerplate/tree/tutorial_1c">Tutorial 1c</a>
13
+
14
+
<aname="step4"></a>
15
+
### Step 4: Create the Actions
16
+
17
+
<b>ADD_QUOTE</b><br>
18
+
This action is the CREATE operation, the new quote is passed to the addQuote function.
19
+
20
+
<b>QUOTES_AVAILABLE</b><br>
21
+
This action will act as the READ operation, the quotes are passed to the addQuotes function.
22
+
23
+
<b>UPDATE_QUOTE</b><br>
24
+
This action is the UPDATE operation, the updated quote is passed to the updateQuote function.
25
+
26
+
<b>DELETE_QUOTE</b><br>
27
+
This action is the DELETE operation, the deleted quote id is passed to the deleteQuote function.
28
+
29
+
30
+
<aname="step5"></a>
31
+
### Step 5: Create the Reducer
32
+
33
+
<b>ADD_QUOTE</b><br>
34
+
The state 'quotes' variable is cloned and the new quote is pushed to the top of the cloned object, the state 'quotes' variable is replaced with the clone object.
35
+
36
+
<b>QUOTES_AVAILABLE</b><br>
37
+
The state 'quotes' variable is updated with the quotes array dispatched to the reducer.
38
+
39
+
<b>UPDATE_QUOTE</b><br>
40
+
The state 'quotes' variable is cloned, the id of the quote dispatched to the reducer is used to find the index of the quote in the cloned object.
41
+
The quote at that index is replaced with the quote dispatched to the reducer. The state 'quotes' variable is replaced with the clone object.
42
+
43
+
<b>DELETE_QUOTE</b><br>
44
+
The state 'quotes' variable is cloned, the id dispatched to the reducer is used to find the index of the quote in the cloned object.
45
+
The quote at that index is removed and the state 'quotes' variable is replaced with the clone object.
46
+
47
+
### FOLLOW Step 7 in <ahref="https://github.com/MosesEsan/mesan-react-native-hooks-redux-boilerplate/tree/tutorial_1c">Tutorial 1c</a> to create the Redux Store.
48
+
49
+
50
+
51
+
The rest of the tutorial is available on my <ahref=""target="_blank">blog</a>.
0 commit comments