Skip to content

Commit dcc87cf

Browse files
committed
feat: ✨ Finished 14%
- Translated half of Step 1
1 parent 2b96ef2 commit dcc87cf

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/content/learn/extracting-state-logic-into-a-reducer.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ Reducer হলো state হ্যান্ডেল করার একটি
187187
2. একটি reducer function **লিখুন**
188188
3. reducer টিকে আপনার কম্পোনেন্ট থেকে **ইউজ করুন**
189189

190-
### Step 1: Move from setting state to dispatching actions {/*step-1-move-from-setting-state-to-dispatching-actions*/}
190+
### ধাপ ১: State কে set করার বদলে action কে dispatch করতে শুরু করুন {/*step-1-move-from-setting-state-to-dispatching-actions*/}
191191

192-
Your event handlers currently specify _what to do_ by setting state:
192+
State কে set করার মাধ্যমে আপনার event handler গুলো বর্তমানে নির্ধারণ করছে যে কী করতে হবে:
193193

194194
```js
195195
function handleAddTask(text) {
@@ -220,11 +220,11 @@ function handleDeleteTask(taskId) {
220220
}
221221
```
222222

223-
Remove all the state setting logic. What you are left with are three event handlers:
223+
এখন সব state সেট করার logic দূর করে দিন। এখন আপনার কাছে যা বাকি থাকবে তা হলো:
224224

225-
- `handleAddTask(text)` is called when the user presses "Add".
226-
- `handleChangeTask(task)` is called when the user toggles a task or presses "Save".
227-
- `handleDeleteTask(taskId)` is called when the user presses "Delete".
225+
- ইউজার যখন "Add" প্রেস করে তখন call করা হয় `handleAddTask(text)`
226+
- ইউজার যখন "Save" প্রেস করে কিংবা কোনো task কে toggle (বা edit) করে তখন call করা হয় `handleChangeTask(task)`
227+
- ইউজার যখন "Delete" প্রেস করে তখন call করা হয় `handleDeleteTask(taskId)`
228228

229229
Managing state with reducers is slightly different from directly setting state. Instead of telling React "what to do" by setting state, you specify "what the user just did" by dispatching "actions" from your event handlers. (The state update logic will live elsewhere!) So instead of "setting `tasks`" via an event handler, you're dispatching an "added/changed/deleted a task" action. This is more descriptive of the user's intent.
230230

0 commit comments

Comments
 (0)