mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 01:42:31 +00:00
get rid of feel-good code
This commit is contained in:
parent
66a6b6d89b
commit
b169089156
@ -46,26 +46,9 @@ define([], function () {
|
||||
transactionService.startTransaction();
|
||||
}
|
||||
|
||||
if (!MUTATION_TRACKER.has(domainObject)) {
|
||||
MUTATION_TRACKER.set(domainObject, domainObject
|
||||
.getCapability('mutation')
|
||||
.listen(function () {})
|
||||
);
|
||||
}
|
||||
|
||||
function unlistenAndCall(f) {
|
||||
return function () {
|
||||
if (MUTATION_TRACKER.has(domainObject)) {
|
||||
MUTATION_TRACKER.get(domainObject)();
|
||||
MUTATION_TRACKER.delete(domainObject);
|
||||
}
|
||||
return f();
|
||||
}
|
||||
}
|
||||
|
||||
transactionService.addToTransaction(
|
||||
unlistenAndCall(persistence.persist.bind(persistence)),
|
||||
unlistenAndCall(persistence.refresh.bind(persistence))
|
||||
persistence.persist.bind(persistence),
|
||||
persistence.refresh.bind(persistence)
|
||||
);
|
||||
|
||||
if (!wasActive) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user