fix(docs): address generated translation review findings
This commit is contained in:
@@ -3,4 +3,4 @@
|
||||
# after editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write docs/cordis-api/context.md
|
||||
context.md: 320b23de1c8d19e2dacdf0ec9f2361037bcf8048
|
||||
context.zh.md: 2e4cdc1d2822d6cc19bf1907a44cc31c429016ea
|
||||
context.zh.md: 9b1f92a329ff4d75b3fafe7bf6bc8db317bcc267
|
||||
|
||||
@@ -58,7 +58,7 @@ isolate(name: string, label?: symbol)
|
||||
|
||||
创建一个子上下文,使 `name` 拥有独立的服务作用域。
|
||||
|
||||
在返回的上下文之下,对服务 `name` 的读写会根据新标签解析,而不再根据父上下文的标签解析,因此可以提供不同的实现而不影响父作用域。向两次 `isolate()` 调用传入相同的 `label`,可使二者加入同一作用域。
|
||||
在返回的上下文之下,对服务 `name` 的读写会根据新标签解析,而不再根据父上下文的标签解析,因此可以提供不同的实现而不影响父作用域。将同一个 `label` 传给两次 `isolate()` 调用,可使二者加入同一作用域。
|
||||
|
||||
- `name`:要隔离的服务名称。
|
||||
- `label`:要加入的作用域标签;默认为一个新建的唯一 symbol。
|
||||
@@ -230,7 +230,7 @@ static is(value: any): value is Context
|
||||
|
||||
- `value`:要测试的值。
|
||||
|
||||
如果 `value` 是 Cordis 上下文,**返回** `true`,并收窄其类型。
|
||||
如果返回 `true`,则 `value` 是 Cordis 上下文,并会收窄其类型。
|
||||
|
||||
[源码](../../vendor/cordis/src/context.ts#L61)
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
# after editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write docs/cordis-api/fiber.md
|
||||
fiber.md: 36d2861ac6a53e8186a92d86c65ba228d4b59ee5
|
||||
fiber.zh.md: 8fbc10c9870106f3fc7dfabe9725581898d9ef22
|
||||
fiber.zh.md: fafa559ca911677c43893862190009d82c39c56b
|
||||
|
||||
@@ -29,7 +29,7 @@ effect(execute: () => Effect, label?: string): AsyncDisposable<Promise<void>>
|
||||
|
||||
在此 fiber 上注册一个支持清理的作用。
|
||||
|
||||
`execute` 会立即运行;它产生的清理函数将被收集,并在调用返回的清理函数或卸载 fiber 时按相反顺序运行,以先发生者为准。重复调用清理函数不会产生任何效果。如果 fiber 已经 dispose(资源释放),则抛出 `CordisError('INACTIVE_EFFECT')`;如果 `execute` 返回的结构无效,则抛出 `TypeError`。
|
||||
`execute` 会立即运行;它产生的清理函数将被收集,并在调用返回的清理函数或卸载 fiber 时按相反顺序运行,以先发生者为准。重复调用清理函数不会产生任何效果。如果 fiber 已经 dispose(资源释放),则抛出 `CordisError('INACTIVE_EFFECT')`;如果结构无效,则抛出 `TypeError`,表示 `execute` 返回了不受支持的结果。
|
||||
|
||||
- `execute`:作用主体;可接受的结构见 `Effect`。
|
||||
- `label`:在 `getEffects()` 诊断信息中显示的作用标签。
|
||||
@@ -130,7 +130,7 @@ public store: Dict<Impl> | undefined
|
||||
public inertia: Promise<void> | undefined
|
||||
```
|
||||
|
||||
当前正在进行的加载或卸载转换;如果没有此类转换,则为 `undefined`。
|
||||
当前正在进行的加载或卸载转换;如果没有此类转换,则为 undefined。
|
||||
|
||||
[源码](../../vendor/cordis/src/fiber.ts#L198)
|
||||
|
||||
@@ -185,7 +185,7 @@ effect(execute: () => Effect, label?: string): AsyncDisposable<Promise<void>>
|
||||
|
||||
在此 fiber 上注册一个支持清理的作用。
|
||||
|
||||
`execute` 会立即运行;它产生的清理函数将被收集,并在调用返回的清理函数或卸载 fiber 时按相反顺序运行,以先发生者为准。重复调用清理函数不会产生任何效果。如果 fiber 已经 dispose,则抛出 `CordisError('INACTIVE_EFFECT')`;如果 `execute` 返回的结构无效,则抛出 `TypeError`。
|
||||
`execute` 会立即运行;它产生的清理函数将被收集,并在调用返回的清理函数或卸载 fiber 时按相反顺序运行,以先发生者为准。重复调用清理函数不会产生任何效果。如果 fiber 已经 dispose,则抛出 `CordisError('INACTIVE_EFFECT')`;如果结构无效,则抛出 `TypeError`,表示 `execute` 返回了不受支持的结果。
|
||||
|
||||
- `execute`:作用主体;可接受的结构见 `Effect`。
|
||||
- `label`:在 `getEffects()` 诊断信息中显示的作用标签。
|
||||
|
||||
Reference in New Issue
Block a user