mirror of
https://github.com/nasa/openmct.git
synced 2025-06-14 21:28:12 +00:00
[Persistence] Rename bundle
Rename bundle for queued persistence. WTD-1033.
This commit is contained in:
@ -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;
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user