[Core] Bring in core bundle from sandbox
Bring in bundle platform/core from the sandbox branch, in preparation for clean up, tests, and integration. WTD-573
This commit is contained in:
38
platform/core/src/capabilities/PersistenceCapability.js
Normal file
38
platform/core/src/capabilities/PersistenceCapability.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* Defines the "persistence" capability, used to indicate
|
||||
* that changes to an object should be written to some
|
||||
* underlying store.
|
||||
*
|
||||
* Current implementation is a stub that simply triggers
|
||||
* a refresh on modified views, which is a necessary
|
||||
* side effect of persisting the object.
|
||||
*/
|
||||
define(
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
function PersistenceCapability(persistenceService, SPACE, domainObject) {
|
||||
var self = {
|
||||
persist: function () {
|
||||
return persistenceService.updateObject(
|
||||
SPACE,
|
||||
domainObject.getId(),
|
||||
domainObject.getModel()
|
||||
);
|
||||
},
|
||||
getSpace: function () {
|
||||
return SPACE;
|
||||
},
|
||||
invoke: function () {
|
||||
return self;
|
||||
}
|
||||
};
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
return PersistenceCapability;
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user