Always put in cache on mutation, assuming persistence
This commit is contained in:
@@ -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)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user