-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Postfixing should be simpler #4161
Comments
Recently we had that dilemma with @Reinmar. We agreed that having "empty"
I am not sure how you want to prevent this :S. I mean, isn't this the same as just checking whether a change still should be applied (so the same as point above)? |
It would be very bad for the efficiency. You will add callback function for event change, even if it's not needed. |
Instead, we should:
|
It's partially done, together with introducing differ, and will be fixed by https://github.com/ckeditor/ckeditor5-engine/issues/1207. |
It's pretty common case that some plugin listens on the change event and what to apply some changes.
It's pretty simple to make it works, but you need a lot of know-how to make it works well. You need to remember about couple thing.
enqueueChanges
, otherwise there might be no render call.enqueueChanges
block some other changes may happen and that we need to check it again inside the block if the condition is still valid.enqueueChanges
if it's needed only once.We need a helper which will do all of this for us, so all fixers will work well. It could get 2 functions as parameters: condition and action, and take care about everything.
The text was updated successfully, but these errors were encountered: