From 2c8c26f438bb521ea98cd69e17c769a907c4b2aa Mon Sep 17 00:00:00 2001 From: jos Date: Wed, 20 May 2015 11:56:24 +0200 Subject: [PATCH] Deprecated functions `DataSet.subscribe` and `DataSet.unsubscribe` --- lib/DataSet.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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