mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
Always put in cache on mutation, assuming persistence
This commit is contained in:
parent
d74eba1922
commit
66a6b6d89b
@ -39,6 +39,8 @@ define([], function () {
|
|||||||
mutationTopic.listen(function (domainObject) {
|
mutationTopic.listen(function (domainObject) {
|
||||||
var persistence = domainObject.getCapability('persistence');
|
var persistence = domainObject.getCapability('persistence');
|
||||||
var wasActive = transactionService.isActive();
|
var wasActive = transactionService.isActive();
|
||||||
|
cacheService.put(domainObject.getId(), domainObject.getModel());
|
||||||
|
|
||||||
if (persistence.persisted()) {
|
if (persistence.persisted()) {
|
||||||
if (!wasActive) {
|
if (!wasActive) {
|
||||||
transactionService.startTransaction();
|
transactionService.startTransaction();
|
||||||
@ -51,8 +53,6 @@ define([], function () {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
cacheService.put(domainObject.getId(), domainObject.getModel());
|
|
||||||
|
|
||||||
function unlistenAndCall(f) {
|
function unlistenAndCall(f) {
|
||||||
return function () {
|
return function () {
|
||||||
if (MUTATION_TRACKER.has(domainObject)) {
|
if (MUTATION_TRACKER.has(domainObject)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user