docs(service): document $model loading/error last-write semantics - #245
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #222(不修代码,按约定改成文档限制)。
$model.method.loading是布尔开关不是 pending 计数;$model.method.error是最近一次写入,重叠调用无法对应到具体哪一次。给 loading 加计数也消不掉 error 的二义性,实际 UI 里同名方法重叠也很少,因此保持现实现,只在文档里标明:MethodState/$modelJSDocpackages/service/docs/usage.md已知限制Test plan
__createMethodWrapper现行为一致(任意一次结算loading=false;新调用开始清error)