Skip to content

Commit

Permalink
Rename {dimension,group}.remove to dispose.
Browse files Browse the repository at this point in the history
The remove methods are kept for backwards-compatibility.
  • Loading branch information
jasondavies committed Aug 30, 2013
1 parent e645b9e commit ec1383c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 29 deletions.
17 changes: 10 additions & 7 deletions crossfilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ function crossfilter() {
bottom: bottom,
group: group,
groupAll: groupAll,
remove: remove
dispose: dispose,
remove: dispose // for backwards-compatibility
};

var one = ~m & -~m, // lowest unset bit as mask, e.g., 00001000
Expand Down Expand Up @@ -865,7 +866,8 @@ function crossfilter() {
order: order,
orderNatural: orderNatural,
size: size,
remove: remove
dispose: dispose,
remove: dispose // for backwards-compatibility
};

// Ensure that this group will be removed when the dimension is removed.
Expand Down Expand Up @@ -1155,7 +1157,7 @@ function crossfilter() {
}

// Removes this group and associated event listeners.
function remove() {
function dispose() {
var i = filterListeners.indexOf(update);
if (i >= 0) filterListeners.splice(i, 1);
i = indexListeners.indexOf(add);
Expand All @@ -1180,8 +1182,8 @@ function crossfilter() {
return g;
}

function remove() {
dimensionGroups.forEach(function(group) { group.remove(); });
function dispose() {
dimensionGroups.forEach(function(group) { group.dispose(); });
var i = dataListeners.indexOf(preAdd);
if (i >= 0) dataListeners.splice(i, 1);
i = dataListeners.indexOf(postAdd);
Expand All @@ -1204,7 +1206,8 @@ function crossfilter() {
reduceCount: reduceCount,
reduceSum: reduceSum,
value: value,
remove: remove
dispose: dispose,
remove: dispose // for backwards-compatibility
};

var reduceValue,
Expand Down Expand Up @@ -1299,7 +1302,7 @@ function crossfilter() {
}

// Removes this group and associated event listeners.
function remove() {
function dispose() {
var i = filterListeners.indexOf(update);
if (i >= 0) filterListeners.splice(i);
i = dataListeners.indexOf(add);
Expand Down
2 changes: 1 addition & 1 deletion crossfilter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ec1383c

Please sign in to comment.