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
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -379,11 +379,11 @@ function tasksReducer(tasks, action) {
379
379
380
380
<DeepDive>
381
381
382
-
#### Why are reducers called this way? {/*why-are-reducers-called-this-way*/}
382
+
#### Reducer কে কেনো এভাবে call করা হয়? {/*why-are-reducers-called-this-way*/}
383
383
384
-
Although reducers can "reduce" the amount of code inside your component, they are actually named after the[`reduce()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce)operation that you can perform on arrays.
384
+
যদিও reducer আপনার কম্পোনেন্টের ভিতরে কোডের পরিমাণ কমাতে পারে, কিন্তু reducer নাম দেয়ার পিছনে আসল রহস্য হচ্ছে[`reduce()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce)অপারেশন, যেটি আপনি array এর উপর প্রয়োগ করতে পারেন।
385
385
386
-
The `reduce()`operation lets you take an array and "accumulate" a single value out of many:
386
+
`reduce()`অপারেশনটি আপনাকে একটি array এর একাধিক ভ্যালুকে "একত্র করে" একটি ভ্যালুতে নিয়ে আনার ক্ষমতা দেয়:
387
387
388
388
```
389
389
const arr = [1, 2, 3, 4, 5];
@@ -392,9 +392,9 @@ const sum = arr.reduce(
392
392
); // 1 + 2 + 3 + 4 + 5
393
393
```
394
394
395
-
The function you pass to `reduce` is known as a "reducer". It takes the _result so far_ and the _current item,_then it returns the _next result._React reducers are an example of the same idea: they take the _state so far_ and the _action_, and return the _next state._ In this way, they accumulate actions over time into state.
395
+
`reduce` কে আপনি যে ফাংশনটি পাস করেন তাকে বলা হয় "reducer"। এটা গ্রহণ করে _এখন অবধি রেজাল্ট_ এবং _বর্তমান item,_তারপর এটা return করে _পরবর্তী রেজাল্ট।_React reducer ও এর অনুরূপ: গ্রহণ করে _এখন অবধি state_ এবং _action_, এবং return করে _পরবর্তী state।_ এমন করে, সময়ের সাথে সেটি action সমূহকে কে state হিসেবে একত্র করে।
396
396
397
-
You could even use the `reduce()`method with an`initialState`and an array of `actions`to calculate the final state by passing your reducer function to it:
397
+
এমনকি আপনি `reduce()`মেথডটি দিয়েও একটি`initialState`এবং একটি `actions`এর array থেকে সর্বশেষ state বের করতে পারবেন, তার জন্য মেথডটিকে আপনার reducer ফাংশনটি পাস করতে হবে:
398
398
399
399
<Sandpack>
400
400
@@ -453,7 +453,7 @@ export default function tasksReducer(tasks, action) {
453
453
454
454
</Sandpack>
455
455
456
-
You probably won't need to do this yourself, but this is similar to what React does!
456
+
আপনার নিজের এমনটা করার প্রয়োজন না হওয়ারই সম্ভাবনা বেশি, তবে এটা React যেভাবে করে দেয় তার মতোই!
0 commit comments