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: support new "block-updated" event. (#2221) #2234

Closed
wants to merge 1 commit into from

Conversation

lijie1129
Copy link

@lijie1129 lijie1129 changed the title feat: support update block data for trigger single event feat: support new "block-updated" event. (#2221) Jan 20, 2023
@lijie1129
Copy link
Author

Why does it need to support a single event

Recently, I tried to make a binding between the YJS and EditorJS.

This is to realize an idea. Please refer to here.

First

Since the synchronization EditorJS changes to the data model (YJS doc) is triggered by onChange.

It is necessary to minimize unnecessary events and avoid performance waste.

Second

In the scenario of multi-person collaborative editing, directly removing and replacing the DOM of the entire block will cause the collaborator to lose the input focus, which will cause experience problems.

Therefore, it is a good way to delegate the work of updating a specific block content to a specific plug-in.

@neSpecc
Copy link
Member

neSpecc commented Feb 17, 2023

Thanks, @lijie1129, it is nice feature and implementation.

We're working on collaborative editing, but we have not designed Tools API change yet. So adding a update method should be agreed.

Do you have a workaround for a while?

@lijie1129
Copy link
Author

Hi, @neSpecc

Thank you for your suggestion. 🤝

I will fix this pr later.

@lijie1129
Copy link
Author

This issue has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants