Sha256: ce43e2c00956ed8fcc89a35f7bbfd47f200d9914673736610566b6c3974ba28d

Contents?: true

Size: 935 Bytes

Versions: 14

Compression:

Stored size: 935 Bytes

Contents

  function extremaBy(source, keySelector, comparer) {
    return new AnonymousObservable(function (o) {
      var hasValue = false, lastKey = null, list = [];
      return source.subscribe(function (x) {
        var comparison, key;
        try {
          key = keySelector(x);
        } catch (ex) {
          o.onError(ex);
          return;
        }
        comparison = 0;
        if (!hasValue) {
          hasValue = true;
          lastKey = key;
        } else {
          try {
            comparison = comparer(key, lastKey);
          } catch (ex1) {
            o.onError(ex1);
            return;
          }
        }
        if (comparison > 0) {
          lastKey = key;
          list = [];
        }
        if (comparison >= 0) { list.push(x); }
      }, function (e) { o.onError(e); }, function () {
        o.onNext(list);
        o.onCompleted();
      });
    }, source);
  }

Version data entries

14 entries across 7 versions & 1 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/_extremaby.js