Simplify events and store listeners only in one place

This commit is contained in:
ahocevar
2019-09-04 16:39:32 +02:00
parent d416866108
commit ebfb20440a
52 changed files with 224 additions and 599 deletions

View File

@@ -7,7 +7,6 @@ import {assert} from '../asserts.js';
import Feature from '../Feature.js';
import GeometryType from '../geom/GeometryType.js';
import {scale as scaleCoordinate, add as addCoordinate} from '../coordinate.js';
import {listen} from '../events.js';
import EventType from '../events/EventType.js';
import {buffer, createEmpty, createOrUpdateFromCoordinate} from '../extent.js';
import Point from '../geom/Point.js';
@@ -88,7 +87,7 @@ class Cluster extends VectorSource {
*/
this.source = options.source;
listen(this.source, EventType.CHANGE, this.refresh, this);
this.source.addEventListener(EventType.CHANGE, this.refresh.bind(this));
}
/**