Skip to content

Commit 2a74b6c

Browse files
authored
Merge pull request #492 from ryoAccount/translate-effect-scope
2 parents fc2cee4 + b974583 commit 2a74b6c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/api/effect-scope.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Effect Scope API <Badge text="3.2+" />
1+
# エフェクトスコープ API <Badge text="3.2+" />
22

33
:::info
4-
Effect scope is an advanced API primarily intended for library authors. For details on how to leverage this API, please consult its corresponding [RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0041-reactivity-effect-scope.md).
4+
エフェクトスコープは、主にライブラリの作成者を対象とした高度な API です。この API を活用する方法の詳細は、対応する [RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0041-reactivity-effect-scope.md) を参照してください。
55
:::
66

77
## `effectScope`
88

9-
Creates an effect scope object which can capture the reactive effects (e.g. computed and watchers) created within it so that these effects can be disposed together.
9+
エフェクトスコープのオブジェクトを生成します。このオブジェクト内で生成されたリアクティブなエフェクト(例:computed や watcher)を補足して、これらのエフェクトを一緒に処理できるようにします。
1010

11-
**Typing:**
11+
**タイピング:**
1212

1313
```ts
1414
function effectScope(detached?: boolean): EffectScope
1515

1616
interface EffectScope {
17-
run<T>(fn: () => T): T | undefined // undefined if scope is inactive
17+
run<T>(fn: () => T): T | undefined // スコープが非アクティブの場合は undefined
1818
stop(): void
1919
}
2020
```
2121

22-
**Example:**
22+
**:**
2323

2424
```js
2525
const scope = effectScope()
@@ -32,27 +32,27 @@ scope.run(() => {
3232
watchEffect(() => console.log('Count: ', doubled.value))
3333
})
3434

35-
// to dispose all effects in the scope
35+
// スコープ内のすべてのエフェクトを破棄する
3636
scope.stop()
3737
```
3838

3939
## `getCurrentScope`
4040

41-
Returns the current active [effect scope](#effectscope) if there is one.
41+
現在アクティブな[エフェクトスコープ](#effectscope)を返します。
4242

43-
**Typing:**
43+
**タイピング:**
4444

4545
```ts
4646
function getCurrentScope(): EffectScope | undefined
4747
```
4848

4949
## `onScopeDispose`
5050

51-
Registers a dispose callback on the current active [effect scope](#effectscope). The callback will be invoked when the associated effect scope is stopped.
51+
現在アクティブな[エフェクトスコープ](#effectscope)を破棄するコールバックを登録します。コールバックは関連するエフェクトスコープが停止したときに呼び出されます。
5252

53-
This method can be used as a non-component-coupled replacement of `onUnmounted` in reusable composition functions, since each Vue component's `setup()` function is also invoked in an effect scope.
53+
このメソッドは、各 Vue コンポーネントの `setup()` 関数もエフェクトスコープで呼び出すため、再利用可能に構成された関数の `onUnmounted` の非結合コンポーネントの代替として使用できます。
5454

55-
**Typing:**
55+
**タイピング:**
5656

5757
```ts
5858
function onScopeDispose(fn: () => void): void

0 commit comments

Comments
 (0)