Skip to content

docs(service): document $model loading/error last-write semantics - #245

Merged
ximing merged 1 commit into
masterfrom
docs/model-loading-last-write
Aug 31, 2026
Merged

docs(service): document $model loading/error last-write semantics#245
ximing merged 1 commit into
masterfrom
docs/model-loading-last-write

Conversation

@ximing

@ximing ximing commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #222(不修代码,按约定改成文档限制)。

$model.method.loading 是布尔开关不是 pending 计数;$model.method.error 是最近一次写入,重叠调用无法对应到具体哪一次。给 loading 加计数也消不掉 error 的二义性,实际 UI 里同名方法重叠也很少,因此保持现实现,只在文档里标明:

  • MethodState / $model JSDoc
  • packages/service/docs/usage.md 已知限制
  • rab-react skill 异步操作说明

Test plan

  • 无运行时改动
  • JSDoc / usage 描述与 __createMethodWrapper 现行为一致(任意一次结算 loading=false;新调用开始清 error

loading is a boolean, not a pending count; error cannot be attributed
when the same method overlaps. Document as a known limitation rather
than encoding a count that still leaves error ambiguous.

Closes #222
@ximing
ximing merged commit cf0c308 into master Aug 31, 2026
2 checks passed
@ximing
ximing deleted the docs/model-loading-last-write branch August 31, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

service: $model.loading 是无计数的布尔值,并发同名调用提前归零

1 participant