Skip to content

Commit a30c056

Browse files
authored
91. satırda kaldım
technically can be any iterable, but usually an array çevirisi yapılmadı 77. satır.
1 parent 41c1412 commit a30c056

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

1-js/11-async/05-promise-api/article.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Buradaki gibi:
1717
let promise = new Promise(resolve => resolve(value));
1818
```
1919

20-
The method is used when we already have a value, but would like to have it "wrapped" into a promise.
20+
Yöntem zaten bir değere sahipken kullanılır. Ancal bir söz içine "sarılmış" olmasını ister.
2121

22-
For instance, the `loadCached` function below fetches the `url` and remembers the result, so that future calls on the same URL return it immediately:
22+
Örneğin, `loadCached` fonksiyonu aşağıda `url`yi alır ve sonucu hatırlar. Böylece aynı URL'deki gelecekteki çağrılar hemen döndürülür.
2323

2424
```js
2525
function loadCached(url) {
@@ -40,52 +40,52 @@ function loadCached(url) {
4040
}
4141
```
4242

43-
We can use `loadCached(url).then(…)`, because the function is guaranteed to return a promise. That's the purpose `Promise.resolve` serves in the line `(*)`: it makes sure the interface is unified. We can always use `.then` after `loadCached`.
43+
`loadCached(url).then(…)` kullanabiliriz. Çünkü fonksiyonun bir söz döndürmesi garantilidir. Amaç `Promise.resolve` `(*)` doğrultusunda hizmet eder: Arayüzünün birleşik olduğundan emin olun. `.then`den sonra her zaman `loadCached` kullanabiliriz.
4444

4545
## Promise.reject
4646

47-
The syntax:
47+
Söz dizimi:
4848

4949
```js
5050
let promise = Promise.reject(error);
5151
```
5252

53-
Create a rejected promise with the `error`.
53+
`error` ile reddedilen bir söz oluşturun.
5454

55-
Same as:
55+
Yukarıdaki ile aynı:
5656

5757
```js
5858
let promise = new Promise((resolve, reject) => reject(error));
5959
```
6060

61-
We cover it here for completeness, rarely used in real code.
61+
Gerçek kodda nadiren kullanılan, bütünlük için buradayız.
6262

6363
## Promise.all
6464

65-
Let's say we want to run many promises to execute in parallel, and wait till all of them are ready.
65+
Paralel olarak yürütülmek için birçok söz vermek isteriz ve hepsinin hazır olmasını bekleriz.
6666

67-
For instance, download several URLs in parallel and process the content when all are done.
67+
Örneğin, paralel olarak birkaç URL'yi indirin ve hepsi bittiğinde içeriği işleyin.
6868

69-
That's what `Promise.all` is for.
69+
Bunun için `Promise.all`.
7070

71-
The syntax is:
71+
Söz dizimi:
7272

7373
```js
7474
let promise = Promise.all([...promises...]);
7575
```
7676

77-
It takes an array of promises (technically can be any iterable, but usually an array) and returns a new promise.
77+
Yeni bir söz alır ve bir dizi söz alır (technically can be any iterable, but usually an array.)
7878

79-
The new promise resolves when all listed promises are settled and has an array of their results.
79+
Yeni söz, listelenen tüm sözlerin yerine getirildiği ve sonuçların bir dizisine sahip olduğunda karar verir.
8080

81-
For instance, the `Promise.all` below settles after 3 seconds, and then its result is an array `[1, 2, 3]`:
81+
Örneğin, aşağıdaki `Promise.all` 3 saniye sonra yerleşir ve sonucu `[1, 2, 3]` dizisidir:
8282

8383
```js run
8484
Promise.all([
8585
new Promise(resolve => setTimeout(() => resolve(1), 3000)), // 1
8686
new Promise(resolve => setTimeout(() => resolve(2), 2000)), // 2
8787
new Promise(resolve => setTimeout(() => resolve(3), 1000)) // 3
88-
]).then(alert); // 1,2,3 when promises are ready: each promise contributes an array member
88+
]).then(alert); // 1,2,3 sözler hazır olduğunda: her söz bir dizi üyesine katkıda bulunur
8989
```
9090

9191
Please note that the relative order is the same. Even though the first promise takes the longest time to resolve, it is still first in the array of results.

0 commit comments

Comments
 (0)