Browse Source

Deprecated functions `DataSet.subscribe` and `DataSet.unsubscribe`

flowchartTest
jos 9 years ago
parent
commit
2c8c26f438
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      lib/DataSet.js

+ 8
- 4
lib/DataSet.js View File

@ -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 * 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 * Trigger an event

Loading…
Cancel
Save