view src/djol/listen.js @ 23:1d72fddc319a

make eslint happy
author cin
date Wed, 06 Dec 2017 14:19:45 +0300
parents f0035923ff3e
children
line wrap: on
line source

define(["ol"], function(ol) {

    var listen = function(target, event, callback) {
        var key = target.on(event, callback);
        return {
            remove : function() {
                ol.Observable.unByKey(key);
            }
        };
    };

    listen.once =  function(target, event, callback) {
        var key = target.once(event, callback);
        return {
            remove : function() {
                ol.Observable.unByKey(key);
            }
        };
    };

    return listen;
});