Skip to content

Commit

Permalink
Use arrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh authored and mourner committed Oct 18, 2016
1 parent a15bd48 commit 875edf2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/source/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ util.extend(Worker.prototype, {
if (!this.workerSources[mapId][type]) {
// simple accessor object for passing to WorkerSources
const layers = {
getLayers: function () { return this.layers[mapId]; }.bind(this),
getLayerFamilies: function () { return this.layerFamilies[mapId]; }.bind(this)
getLayers: () => this.layers[mapId],
getLayerFamilies: () => this.layerFamilies[mapId]
};

// use a wrapped actor so that we can attach a target mapId param
// to any messages invoked by the WorkerSource
const actor = {
send: function (type, data, callback, buffers) {
send: (type, data, callback, buffers) => {
this.actor.send(type, data, callback, buffers, mapId);
}.bind(this)
}
};

this.workerSources[mapId][type] = new this.workerSourceTypes[type](actor, layers);
Expand Down

0 comments on commit 875edf2

Please sign in to comment.