devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
47 lines (46 loc) • 1.35 kB
JavaScript
/**
* DevExtreme (cjs/__internal/viz/vector_map/data_exchanger.js)
* Version: 26.1.6
* Build date: Fri Oct 16 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DataExchanger = void 0;
var _callbacks = require("../../core/utils/callbacks");
let DataExchanger = exports.DataExchanger = class {
constructor() {
this._store = {}
}
dispose() {
this._store = null;
return this
}
_get(category, name) {
const store = this._store[category] || (this._store[category] = {});
return store[name] || (store[name] = {
callbacks: (0, _callbacks.Callbacks)()
})
}
set(category, name, data) {
const item = this._get(category, name);
item.data = data;
item.callbacks.fire(data);
return this
}
bind(category, name, callback) {
const item = this._get(category, name);
item.callbacks.add(callback);
item.data && callback(item.data);
return this
}
unbind(category, name, callback) {
const item = this._get(category, name);
item.callbacks.remove(callback);
return this
}
};