[Persistence] Rename bundle

Rename bundle for queued persistence. WTD-1033.
This commit is contained in:
Victor Woeltjen
2015-03-20 13:13:26 -07:00
parent 62e88abbd2
commit 7b6ecd7bd7
10 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,31 @@
/*global define*/
define(
[],
function () {
"use strict";
/**
* The QueuingPersistenceCapability places `persist` calls in a queue
* to be handled in batches.
* @param {PersistenceQueue} queue of persistence calls
* @param {PersistenceCapability} persistence the wrapped persistence
* capability
* @param {DomainObject} domainObject the domain object which exposes
* the capability
*/
function QueuingPersistenceCapability(queue, persistence, domainObject) {
var queuingPersistence = Object.create(persistence),
id = domainObject.getId();
// Override persist calls to queue them instead
queuingPersistence.persist = function () {
queue.put(id, persistence);
};
return queuingPersistence;
}
return QueuingPersistenceCapability;
}
);