-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Introduce editor.transaction()
to replace without*
functions
#2658
Comments
Sounds good and I think this would meet all of my requirements for this feature. |
Another benefit: I often find myself using these
than
|
@ianstormtaylor @brendancarney I am still pretty new to slate. So this seems kind of solved to me and can probabbly be closed? |
I agree that withoutNormalizing has effectively become what was proposed, so I'm closing this. Thanks! |
Introduce
editor.transaction()
The
withoutSaving
,withoutNormalizing
, anwithoutMerging
function behave in similar ways, creating a scope where saving and normalizing don't occur.withoutNormalizing
is a little misleading, because it does normalize, it's just deferred until the end. I think these can be expressed with a single concept,editor.transaction()
. A transaction is a concept that will be familiar to other programmers as an explicit way to group a set of changes. It's best explained by examples:Basic Use (
withoutNormalization
)This is equivalent to the current
withoutNormalizing
. It defers normalization until the end, and groups everything inside into one save point.withoutSaving
Adding
{ save: false }
will skip adding a save point to the editor.withoutMerging
To accomplish
withoutMerging
, you would instead manually specify save points. Everything up until that point would be grouped into a save point.More control over normalization.
Normalize when you want to:
Or don't at all:
Main benefits
The text was updated successfully, but these errors were encountered: