-
-
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
Init plugin #2540
Comments
We had a talk with @scofalik and @ma2ciek and realized that when the users' selection plugin will be enabled the pending action will be added for 500 ms every time any user changes the selection. After that timeout, First, we need to check if it will be a problem in real cases. Editor blur will not cause selection change, so the user should be able to finish editing if no one will not move selection for 500 ms. It might be good enough. If this will be a problem we have some solution. Solution 1 - data viewKeep data view the same way we have editing view. I will allow up to observe if data changed and make Solution 2 - markers optionSince it is usually a marker what changes model the way that data do not change, we may have an option in Solution 3 - autosave.flushWe make have a method which will flush throttling and remove pending action if it is not needed. Such method should be called before finishing editing in order to make sure that there are no outdated pending actions. I do not like this solution and all variants described below. It introduces an additional method to remove pending action which should not be added in the first place. Solution 3.1 - pendingActions.refreshWe could make it part of the pending actions plugin interface. Solution 3.1 - a refresh on pending actions gettersWe could also make it automatically. Refresh event could be fired whenever one wants to get the list of pending actions. But it is a bad smell to change the collection on collection getter. Solution 4 (a.k.a. Workaround 1) - hardcoded ifFor now, it might be the simples solution to check if what changed is users markers or something else. I know it is ugly, but it might be enough for a long time. I believe that other changes, even if not causes data change, will not occur often enough to make any problems with autosave. |
For easier integration, we should provide the
Autosave
plugin.provider
property with a singlesave
method which returns promise when save is done.throttle
onchange
event (500 ms).provider.save( data )
should return promise when data are saved. Pending action should be removed then if there were no other changes in the meantime.After that, it should be enough to check pending actions to learn if the editor can be closed.
The text was updated successfully, but these errors were encountered: