choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
39 lines (32 loc) • 1.02 kB
JavaScript
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import { getConfig } from '../../../es/configure';
import PromiseMerger from '../_util/PromiseMerger';
export var AttachmentStore =
/*#__PURE__*/
function () {
function AttachmentStore() {
_classCallCheck(this, AttachmentStore);
this.batchCallback = function (uuids) {
var _getConfig = getConfig('attachment'),
batchFetchCount = _getConfig.batchFetchCount;
if (batchFetchCount) {
return batchFetchCount(uuids);
}
return Promise.resolve({});
};
this.merger = new PromiseMerger(this.batchCallback, {
maxAge: 60000,
max: 100
});
}
_createClass(AttachmentStore, [{
key: "fetchCountInBatch",
value: function fetchCountInBatch(uuid) {
return this.merger.add(uuid);
}
}]);
return AttachmentStore;
}();
export default new AttachmentStore();
//# sourceMappingURL=AttachmentStore.js.map