Skip to content

Commit

Permalink
Merge pull request Reactive-Extensions#509 from chicoxyzzy/rename_con…
Browse files Browse the repository at this point in the history
…tains_to_includes

deprecate 'contains' operator in favour of `includes` operator
  • Loading branch information
mattpodwysocki committed Jan 20, 2015
2 parents 9dba472 + 4b6406c commit 6924b84
Show file tree
Hide file tree
Showing 27 changed files with 129 additions and 83 deletions.
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ var browsers = [{
'src/core/linq/observable/some.js', // where
'src/core/linq/observable/isempty.js', // any, select
'src/core/linq/observable/every.js', // where, any
'src/core/linq/observable/contains.js', // where, any
'src/core/linq/observable/includes.js', // where, any
'src/core/linq/observable/count.js', // where, aggregate
'src/core/linq/observable/indexof.js',
'src/core/linq/observable/sum.js', // select, aggregate
Expand Down Expand Up @@ -465,7 +465,7 @@ var browsers = [{
'src/core/linq/observable/some.js', // where
'src/core/linq/observable/isempty.js', // any, select
'src/core/linq/observable/every.js', // where, any
'src/core/linq/observable/contains.js', // where, any
'src/core/linq/observable/includes.js', // where, any
'src/core/linq/observable/count.js', // where, aggregate
'src/core/linq/observable/indexof.js',
'src/core/linq/observable/sum.js', // select, aggregate
Expand Down Expand Up @@ -1298,7 +1298,7 @@ var browsers = [{
'src/core/linq/observable/some.js', // where
'src/core/linq/observable/isempty.js', // any, select
'src/core/linq/observable/every.js', // where, any
'src/core/linq/observable/contains.js', // where, any
'src/core/linq/observable/includes.js', // where, any
'src/core/linq/observable/count.js', // where, aggregate
'src/core/linq/observable/indexof.js',
'src/core/linq/observable/sum.js', // select, aggregate
Expand Down
13 changes: 10 additions & 3 deletions dist/rx.aggregates.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@
};

/**
* Determines whether an observable sequence contains a specified element with an optional equality comparer.
* Determines whether an observable sequence includes a specified element with an optional equality comparer.
* @param searchElement The value to locate in the source sequence.
* @param {Number} [fromIndex] An equality comparer to compare elements.
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value from the given index.
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence includes an element that has the specified value from the given index.
*/
observableProto.contains = function (searchElement, fromIndex) {
observableProto.includes = function (searchElement, fromIndex) {
var source = this;
function comparer(a, b) {
return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b)));
Expand Down Expand Up @@ -267,6 +267,13 @@
}, this);
};

/**
* @deprecated use #includes instead.
*/
observableProto.contains = function (searchElement, fromIndex) {
//deprecate('contains', 'includes');
observableProto.includes(searchElement, fromIndex);
};
/**
* Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items.
* @example
Expand Down
2 changes: 1 addition & 1 deletion dist/rx.aggregates.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rx.aggregates.min.js

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

Loading

0 comments on commit 6924b84

Please sign in to comment.