Skip to content

Commit 0d89ed2

Browse files
authored
handle
1 parent c84a77a commit 0d89ed2

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

1-js/11-async/02-promise-basics/article.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,30 +123,30 @@ let promise = new Promise(function(resolve, reject) {
123123
خوبه. ما بلافاصله یک وعده(promise) حل‌شده(resolved) داریم.
124124
````
125125
126-
```smart header="The `state` and `result` are internal"
127-
The properties `state` and `result` of the Promise object are internal. We can't directly access them. We can use the methods `.then`/`.catch`/`.finally` for that. They are described below.
128-
```
126+
```smart header="داخلی هستند `result` و `state`"
127+
.استفاده کنیم. در زیر توضیح داده شده‌اند `.then`/`.catch`/`.finally` داخلی هستند. ما نمی‌توانیم مستقیماً به آن‌ها دسترسی داشته باشیم. برای این کار می‌توانیم از متدهای Promise شیء `result` و `state` ویژگی های
128+
`````
129129
130-
## Consumers: then, catch, finally
130+
## مصرف‌کنندگان: then, catch, finally
131131
132-
A Promise object serves as a link between the executor (the "producing code" or "singer") and the consuming functions (the "fans"), which will receive the result or error. Consuming functions can be registered (subscribed) using methods `.then`, `.catch` and `.finally`.
132+
یک شیء Promise به عنوان یک پیوند بین اجراکننده ("کد تولید‌کننده" یا "خواننده") و توابع مصرف‌کننده ("طرفداران") عمل می‌کند که نتیجه یا خطا را دریافت می‌کند. توابع مصرف‌کننده را می‌توان با استفاده از متدهای `then`، `.catch.` و `finally.` ثبت (مشترک) کرد.
133133
134-
### then
134+
### متدِ then
135135
136-
The most important, fundamental one is `.then`.
136+
مهم ترین و اساسی ترین آن `then.` است.
137137
138-
The syntax is:
138+
نحو(syntax) عبارت است از:
139139
140140
```js
141141
promise.then(
142-
function(result) { *!*/* handle a successful result */*/!* },
143-
function(error) { *!*/* handle an error */*/!* }
142+
function(result) { *!*/* یک نتیجه موفق را مدیریت کنید */*/!* },
143+
function(error) { *!*/* یک خطا را مدیریت کنید */*/!* }
144144
);
145145
```
146146
147-
The first argument of `.then` is a function that runs when the promise is resolved, and receives the result.
147+
اولین آرگومان `then.` تابعی است که با حل شدن(resolved) وعده(promise) اجرا می‌شود و نتیجه را دریافت می‌کند.
148148
149-
The second argument of `.then` is a function that runs when the promise is rejected, and receives the error.
149+
آرگومان دوم `then.` تابعی است که با رد شدن(rejected) وعده(promise) اجرا می‌شود و خطا را دریافت می‌کند.
150150
151151
For instance, here's a reaction to a successfully resolved promise:
152152

0 commit comments

Comments
 (0)