diff --git a/lib/DataSet.js b/lib/DataSet.js index 98558bee..e8d1c973 100644 --- a/lib/DataSet.js +++ b/lib/DataSet.js @@ -142,8 +142,10 @@ DataSet.prototype.on = function(event, callback) { }); }; -// TODO: make this function deprecated (replaced with `on` since version 0.5) -DataSet.prototype.subscribe = DataSet.prototype.on; +// TODO: remove this deprecated function some day (replaced with `on` since version 0.5, deprecated since v4.0) +DataSet.prototype.subscribe = function () { + throw new Error('DataSet.subscribe is deprecated. Use DataSet.on instead.'); +}; /** * Unsubscribe from an event, remove an event listener @@ -157,8 +159,10 @@ DataSet.prototype.off = function(event, callback) { } }; -// TODO: make this function deprecated (replaced with `on` since version 0.5) -DataSet.prototype.unsubscribe = DataSet.prototype.off; +// TODO: remove this deprecated function some day (replaced with `on` since version 0.5, deprecated since v4.0) +DataSet.prototype.unsubscribe = function () { + throw new Error('DataSet.unsubscribe is deprecated. Use DataSet.off instead.'); +}; /** * Trigger an event