Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文档补全 #30

Open
fengzi2016 opened this issue Jun 17, 2021 · 0 comments
Open

文档补全 #30

fengzi2016 opened this issue Jun 17, 2021 · 0 comments

Comments

@fengzi2016
Copy link

如图:
image
在patch 的时候会自底向上(深度优先遍历)实现每个节点applyPatches
但是在diff的时候是自顶向下搜集每个节点的变更:
image
假设有节点1的变更是这样
image
那patches应该会记录成 {0: reorder, 1: replace, 2: replace}?
但是从代码的输出来看:
image
newChildren = diffs.children 会让根据key变换位置的children去和oldChildren比较,但是在https://www.npmjs.com/package/list-diff2中 对children没有过多介绍,可能会让人有迷惑

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

No branches or pull requests

1 participant