Skip to content

Commit 223310e

Browse files
committed
feat: ✨ Finished 35%
1 parent a430723 commit 223310e

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,25 +284,25 @@ dispatch({
284284

285285
</Note>
286286

287-
### Step 2: Write a reducer function {/*step-2-write-a-reducer-function*/}
287+
### ধাপ ২: একটি reducer function লিখুন {/*step-2-write-a-reducer-function*/}
288288

289-
A reducer function is where you will put your state logic. It takes two arguments, the current state and the action object, and it returns the next state:
289+
একটি reducer function হলো যেখানে আপনি আপনার state লজিক রাখবেন। এটি দুটি argument নেয়, বর্তমান state এবং action অবজেক্ট, অতঃপর এটি পরবর্তী state কে return করেঃ
290290

291291
```js
292292
function yourReducer(state, action) {
293293
// return next state for React to set
294294
}
295295
```
296296

297-
React will set the state to what you return from the reducer.
297+
আপনি reducer থেকে যা return করবেন, React সেটিকে state হিসেবে সেট করে দিবে।
298298

299-
To move your state setting logic from your event handlers to a reducer function in this example, you will:
299+
এই উদাহরণে, state সেট করার লজিককে event handlers থেকে একটি reducer function এ সরাতে, আপনার:
300300

301-
1. Declare the current state (`tasks`) as the first argument.
302-
2. Declare the `action` object as the second argument.
303-
3. Return the _next_ state from the reducer (which React will set the state to).
301+
1. বর্তমান state (`tasks`) কে প্রথম argument হিসেবে declare করতে হবে।
302+
2. `action` অবজেক্টকে দ্বিতীয় argument হিসেবে declare করতে হবে।
303+
3. reducer থেকে _পরবর্তী_ state কে return করতে হবে। (যেটিকে React পরবর্তী state হিসেবে সেট করবে)
304304

305-
Here is all the state setting logic migrated to a reducer function:
305+
সব state সেট করার লজিক reducer function এ সরানোর পর এমন দেখাবেঃ
306306

307307
```js
308308
function tasksReducer(tasks, action) {
@@ -331,7 +331,7 @@ function tasksReducer(tasks, action) {
331331
}
332332
```
333333

334-
Because the reducer function takes state (`tasks`) as an argument, you can **declare it outside of your component.** This decreases the indentation level and can make your code easier to read.
334+
যেহেতু reducer function টি state (`tasks`) কে একটি argument হিসেবে নিচ্ছে, আপনি একে **আপনার কম্পোনেন্টের বাইরে declare করতে পারবেন।** এটা indentation level কমিয়ে আনে এবং আপনার কোডকে পড়তে সহজ করে।
335335

336336
<Note>
337337

0 commit comments

Comments
 (0)