Sha256: 8afa74596a92c1ac2ee2a99902e8472f388eb0b4f36f03b219a6b0f7e6dc3617
Contents?: true
Size: 843 Bytes
Versions: 14
Compression:
Stored size: 843 Bytes
Contents
/** * Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence. * @example * var res = res = source.first(); * var res = res = source.first(function (x) { return x > 3; }); * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence. */ observableProto.first = function (predicate, thisArg) { return predicate ? this.where(predicate, thisArg).first() : firstOrDefaultAsync(this, false); };
Version data entries
14 entries across 7 versions & 1 rubygems