delta-store
Version:
An API for a store with change records
30 lines • 1.07 kB
JavaScript
;
/**
* Created by Papa on 1/10/2016.
*/
var DocumentHandle = (function () {
function DocumentHandle(document, changeList, valuesAddedSubject, valuesArchivedSubject, otherChangesSubject) {
this.document = document;
this.changeList = changeList;
this.valuesAddedSubject = valuesAddedSubject;
this.valuesArchivedSubject = valuesArchivedSubject;
this.otherChangesSubject = otherChangesSubject;
}
DocumentHandle.prototype.addChangeRecord = function (changeRecord) {
var _this = this;
return new Promise(function (resolve, reject) {
_this.changeList.push(changeRecord);
resolve();
});
};
DocumentHandle.prototype.addChangeRecords = function (changeRecords) {
var _this = this;
return new Promise(function (resolve, reject) {
_this.changeList.pushAll(changeRecords);
resolve();
});
};
return DocumentHandle;
}());
exports.DocumentHandle = DocumentHandle;
//# sourceMappingURL=DocumentHandle.js.map