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

feat: add shared demo #15

Merged
merged 5 commits into from
Jul 25, 2024
Merged

feat: add shared demo #15

merged 5 commits into from
Jul 25, 2024

Conversation

huanhuanwa
Copy link
Contributor

No description provided.


// To save memory, convert map to array.
const element = new Y.Array<Y.Array<any>>();
element.insert(0, [fixedFieldArray, customFieldArray]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里正常 array 嵌套 YArray 是不是可能有问题

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是正常 array 嵌套 YArray,是 insert API 的写法
image

for (const fieldId in record['value']) {
customFields.push(record['value'][fieldId]);
}
customFieldArray.insert(0, customFields);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里也是 YArray 嵌套了 array

@pubuzhixing8 pubuzhixing8 merged commit 488a8e1 into develop Jul 25, 2024
13 checks passed
@pubuzhixing8 pubuzhixing8 deleted the shared branch July 25, 2024 10: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.

2 participants