Skip to content

Commit

Permalink
v2.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua DeSeno committed Sep 12, 2014
1 parent d2b5d8a commit f98d76d
Show file tree
Hide file tree
Showing 40 changed files with 13,006 additions and 13,844 deletions.
2 changes: 1 addition & 1 deletion lib/rxjs/rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Rxjs
module Rails
VERSION = "2.3.0"
VERSION = "v2.3.9"
end
end

142 changes: 115 additions & 27 deletions vendor/assets/javascripts/rx.aggregates.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

;(function (factory) {
var objectTypes = {
Expand Down Expand Up @@ -33,22 +33,23 @@
}
}.call(this, function (root, exp, Rx, undefined) {

// References
var Observable = Rx.Observable,
observableProto = Observable.prototype,
CompositeDisposable = Rx.CompositeDisposable,
AnonymousObservable = Rx.AnonymousObservable,
isEqual = Rx.internals.isEqual,
helpers = Rx.helpers,
defaultComparer = helpers.defaultComparer,
identity = helpers.identity,
defaultSubComparer = helpers.defaultSubComparer,
isPromise = helpers.isPromise,
observableFromPromise = Observable.fromPromise;

// Defaults
var argumentOutOfRange = 'Argument out of range',
sequenceContainsNoElements = "Sequence contains no elements.";
// References
var Observable = Rx.Observable,
observableProto = Observable.prototype,
CompositeDisposable = Rx.CompositeDisposable,
AnonymousObservable = Rx.AnonymousObservable,
isEqual = Rx.internals.isEqual,
helpers = Rx.helpers,
not = helpers.not,
defaultComparer = helpers.defaultComparer,
identity = helpers.identity,
defaultSubComparer = helpers.defaultSubComparer,
isPromise = helpers.isPromise,
observableFromPromise = Observable.fromPromise;

// Defaults
var argumentOutOfRange = 'Argument out of range',
sequenceContainsNoElements = "Sequence contains no elements.";

observableProto.finalValue = function () {
var source = this;
Expand Down Expand Up @@ -176,15 +177,13 @@
});
};

/**
* Determines whether an observable sequence is empty.
*
* @memberOf Observable#
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty.
*/
observableProto.isEmpty = function () {
return this.any().select(function (b) { return !b; });
};
/**
* Determines whether an observable sequence is empty.
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty.
*/
observableProto.isEmpty = function () {
return this.any().map(not);
};

/**
* Determines whether all elements of an observable sequence satisfy a condition.
Expand Down Expand Up @@ -698,5 +697,94 @@
return findValue(this, predicate, thisArg, true);
};

return Rx;
function toSet(source, type) {
return new AnonymousObservable(function (observer) {
var s = new type();
return source.subscribe(
s.add.bind(s),
observer.onError.bind(observer),
function () {
observer.onNext(s);
observer.onCompleted();
});
});
}
if (!!root.Set) {
/**
* Converts the observable sequence to a Set if it exists.
* @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
*/
observableProto.toSet = function () {
return toSet(this, root.Set);
};
}

if (!!root.WeakSet) {
/**
* Converts the observable sequence to a WeakSet if it exists.
* @returns {Observable} An observable sequence with a single value of a WeakSet containing the values from the observable sequence.
*/
observableProto.toWeakSet = function () {
return toSet(this, root.WeakSet);
};
}

function toMap(source, type, keySelector, elementSelector) {
return new AnonymousObservable(function (observer) {
var m = new type();
return source.subscribe(
function (x) {
var key;
try {
key = keySelector(x);
} catch (e) {
observer.onError(e);
return;
}

var element = x;
if (elementSelector) {
try {
element = elementSelector(x);
} catch (e) {
observer.onError(e);
return;
}
}

m.set(key, element);
},
observer.onError.bind(observer),
function () {
observer.onNext(m);
observer.onCompleted();
});
});
}

if (!!root.Map) {
/**
* Converts the observable sequence to a Map if it exists.
* @param {Function} keySelector A function which produces the key for the Map.
* @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
* @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
*/
observableProto.toMap = function (keySelector, elementSelector) {
return toMap(this, root.Map, keySelector, elementSelector);
};
}

if (!!root.WeakMap) {
/**
* Converts the observable sequence to a WeakMap if it exists.
* @param {Function} keySelector A function which produces the key for the WeakMap
* @param {Function} [elementSelector] An optional function which produces the element for the WeakMap. If not present, defaults to the value from the observable sequence.
* @returns {Observable} An observable sequence with a single value of a WeakMap containing the values from the observable sequence.
*/
observableProto.toWeakMap = function (keySelector, elementSelector) {
return toMap(this, root.WeakMap, keySelector, elementSelector);
};
}

return Rx;
}));
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/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 f98d76d

Please sign in to comment.