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
Copy file name to clipboardExpand all lines: src/content/learn/extracting-state-logic-into-a-reducer.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1099,17 +1099,17 @@ Reducers কে অবশ্যই pure হতে হবে, যেন সেগ
1099
1099
1100
1100
<Challenges>
1101
1101
1102
-
#### Dispatch actions from event handlers {/*dispatch-actions-from-event-handlers*/}
1102
+
#### ইভেন্ট হ্যান্ডলারস থেকে actions কে dispatch করুন {/*dispatch-actions-from-event-handlers*/}
1103
1103
1104
-
Currently, the event handlers in `ContactList.js`and`Chat.js`have `// TODO`comments. This is why typing into the input doesn't work, and clicking on the buttons doesn't change the selected recipient.
1104
+
এখানে, `ContactList.js`এবং`Chat.js`এর ইভেন্ট হ্যান্ডলারগুলোতে `// TODO`কমেন্ট করা আছে। এজন্যেই ইনপুটটিতে টাইপ করলে কিছু হচ্ছে না, এবং পাশের বাটন গুলোতে ক্লিক করলে মেসেজ রিসিভার বদলাচ্ছেনা।
1105
1105
1106
-
Replace these two `// TODO`s with the code to `dispatch`the corresponding actions. To see the expected shape and the type of the actions, check the reducer in `messengerReducer.js`. The reducer is already written so you won't need to change it. You only need to dispatch the actions in `ContactList.js`and`Chat.js`.
1106
+
এই দুইটি `// TODO` এর জায়গায় নিজ নিজ action গুলো `dispatch`করার কোড লিখুন। action গুলোর কাঙ্ক্ষিত আকৃতি এবং টাইপ জানার জন্য, `messengerReducer.js` এর মধ্যের reducer টি দেখুন। Reducer টি অলরেডি লিখে দেয়া হয়েছে, তাই সেটিতে আপনার কোনো পরিবর্তন আনতে হবেনা। আপনার শুধু `ContactList.js`এবং`Chat.js` এ action গুলো dispatch করতে হবে।
1107
1107
1108
1108
<Hint>
1109
1109
1110
-
The `dispatch`function is already available in both of these components because it was passed as a prop. So you need to call `dispatch`with the corresponding action object.
1110
+
`dispatch`ফাংশনটি অলরেডি উভয় কম্পোনেন্টের মধ্যে বিদ্যমান কারণ সেটিকে প্রপ হিসেবে পাঠিয়ে দেয়া হয়েছিলো। তাই আপনার শুধু `dispatch`এর মধ্যে উপযুক্ত অবজেক্ট দিয়ে কল করতে হবে।
1111
1111
1112
-
To check the action object shape, you can look at the reducer and see which `action`fields it expects to see. For example, the `changed_selection` case in the reducer looks like this:
1112
+
Action অবজেক্টটির আকৃতি চেক করার জন্য, আপনি reducer টির কোড দেখতে পারেন এবং বুঝতে পারেন কোন কোন `action`ফিল্ড সেটি পেতে পারে। যেমন, reducer এ `changed_selection` case টি এমন দেখা যাচ্ছেঃ
1113
1113
1114
1114
```js
1115
1115
case 'changed_selection': {
@@ -1120,7 +1120,7 @@ case 'changed_selection': {
1120
1120
}
1121
1121
```
1122
1122
1123
-
This means that your action object should have a `type: 'changed_selection'`. You also see the `action.contactId`being used, so you need to include a`contactId`property into your action.
1123
+
এর মানে হচ্ছে আপনার action অবজেক্ট এ `type: 'changed_selection'` থাকতে হবে। আপনি আরও দেখতে পাচ্ছেন যে `action.contactId`এখানে ব্যাবহৃত হচ্ছে, তাই আপনার action অবজেক্ট এ একটি`contactId`প্রপার্টি থাকতে হবে।
1124
1124
1125
1125
</Hint>
1126
1126
@@ -1256,7 +1256,7 @@ textarea {
1256
1256
1257
1257
<Solution>
1258
1258
1259
-
From the reducer code, you can infer that actions need to look like this:
1259
+
Reducer এর কোড দেখে, আপনি বুঝতে পারেন যে action গুলো দেখতে এমন হতে হবেঃ
1260
1260
1261
1261
```js
1262
1262
// When the user presses "Alice"
@@ -1272,7 +1272,7 @@ dispatch({
1272
1272
});
1273
1273
```
1274
1274
1275
-
Here is the example updated to dispatch the corresponding messages:
1275
+
এই হলো আগের উদাহরণের সমাধান। এখানের কোডে উপযুক্ত action গুলো dispatch করা হয়েছে।
0 commit comments