Skip to content

Commit 80a65ff

Browse files
committed
translate "Dealing with Possible Blocking Code" in "Others" to ja
1 parent e9bfa4e commit 80a65ff

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

doc/ja/other/timeouts.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,17 @@ JavaScriptは非同期なので、`setTimeout`と`setInterval`関数を使って
4646

4747
`foo`がコードをブロックしている間、`setInterval`は呼び出される予定を確保しています。`foo`が完了した瞬間に、実行を待っている間に**10回**以上呼び出されている事になります。
4848

49-
### Dealing with Possible Blocking Code
49+
### ブロッキング可能なコードの取り扱い
5050

51-
The easiest as well as most controllable solution, is to use `setTimeout` within
52-
the function itself.
51+
簡単かつ、一番コントロール可能な解決法として、関数自体の中で`setTimeout`を使うという方法があります。
5352

5453
function foo(){
55-
// something that blocks for 1 second
54+
// 1秒ブロックする何か
5655
setTimeout(foo, 100);
5756
}
5857
foo();
5958

60-
Not only does this encapsulate the `setTimeout` call, but it also prevents the
61-
stacking of calls and it gives additional control.`foo` itself can now decide
62-
whether it wants to run again or not.
59+
このカプセル化は`setTimeout`の呼び出しだけでなく、呼び出しのスタッキングを防止してより詳細なコントロールが出来ます。`foo`それ自身が今や、再度実行するかしないかを決める事が出来るのです。
6360

6461
### Manually Clearing Timeouts
6562

0 commit comments

Comments
 (0)