You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nested updates are never a good idea, so if we find a $function (or a registerCommand) that has an embedded editor.update we should rewrite it to remove the editor.update. As a companion to this we could add a $defer or something like that which could be used to provide explicit nested update semantics but I doubt we'll actually find any use case for it.
Impact
Bugs will be avoided, code will be easier to test when the effects of updates happen in a sensible order. Nobody really wants to reason about code that looks like this:
that will either execute in A, B, C or A, C, B 🙃 order depending on the context of whether this is called inside of an editor.update (or command listener) or not.
Description
Nested updates are never a good idea, so if we find a
$function
(or aregisterCommand
) that has an embeddededitor.update
we should rewrite it to remove theeditor.update
. As a companion to this we could add a$defer
or something like that which could be used to provide explicit nested update semantics but I doubt we'll actually find any use case for it.Impact
Bugs will be avoided, code will be easier to test when the effects of updates happen in a sensible order. Nobody really wants to reason about code that looks like this:
that will either execute in A, B, C or A, C, B 🙃 order depending on the context of whether this is called inside of an
editor.update
(or command listener) or not.RE #7039 #7037 for recent examples
The text was updated successfully, but these errors were encountered: