Closed xulman closed 2 years ago
hmm, I haven't actually checked for something like AbstractModelUpdater
....
(first ask before shoot, I know... sorry)
Hi, I've revamped this piece. It's been rebased to the latest master.
I could use such "official" way to pause listeners when updating graph, the original code was always clearing the graph. V.
As suggested by Tobias elsewhere, another option would be to allow for controlling the listeners. Like have something like:
model.listeners().pause(); // pseudo code hein
try
{
// Add, remove, do plenty of things in bulk
}
finally
{
model.listeners().resume(); // fire listeners if a change happen.
}
What would you favor?
@xulman do you still need this?
The standard way to pause model listeners and "lock" the model for changes is via
But
startImport
involves cleaning of the model... since I was blind to find how to only update the model without cleaning it first, I propose this PR.