This repository has been archived on 2022-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
hydrogen-web/src/observable/map/BaseObservableMap.js
Bruno Windels 8c5411cb7d moar WIP
2020-04-19 19:02:10 +02:00

29 lines
708 B
JavaScript

import BaseObservable from "../BaseObservable.js";
export default class BaseObservableMap extends BaseObservable {
emitReset() {
for(let h of this._handlers) {
h.onReset();
}
}
// we need batch events, mostly on index based collection though?
// maybe we should get started without?
emitAdd(key, value) {
for(let h of this._handlers) {
h.onAdd(key, value);
}
}
emitUpdate(key, value, ...params) {
for(let h of this._handlers) {
h.onUpdate(key, value, ...params);
}
}
emitRemove(key, value) {
for(let h of this._handlers) {
h.onRemove(key, value);
}
}
}