How to use the xstream.default.fromArray function in xstream

To help you get started, we’ve selected a few xstream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mostjs / core / test / perf / scan.js View on Github external
.add('xstream', function(deferred) {
    runners.runXstream(deferred, xs.fromArray(a).fold(sum, 0).fold(passthrough, 0).last());
  }, options)
  .add('kefir', function(deferred) {
github mostjs / core / test / perf / skipRepeats.js View on Github external
.add('xstream', function(deferred) {
    runners.runXstream(deferred, xs.fromArray(a).compose(xstreamDropRepeats()).fold(sum, 0).last());
  }, options)
  .add('kefir', function(deferred) {
github mostjs / core / test / perf / switch.js View on Github external
.add('xstream', function(deferred) {
    runners.runXstream(deferred, xs.fromArray(a).map(xs.fromArray).flatten().fold(sum, 0).last());
  }, options)
  .add('kefir', function(deferred) {
github mostjs / core / test / perf / concatMap.js View on Github external
.add('xstream', function(deferred) {
    runners.runXstream(deferred, xs.fromArray(a).map(xs.fromArray).compose(xstreamFlattenSequentially).fold(sum, 0).last())
  }, options)
  .add('kefir', function(deferred) {
github mostjs / core / test / perf / chain.js View on Github external
.add('xstream', function(deferred) {
    runners.runXstream(deferred, xs.fromArray(a).map(xs.fromArray).compose(xstreamFlattenConcurrently).fold(sum, 0).last());
  }, options)
  .add('kefir', function(deferred) {
github langhuihui / rx4rx / perf / combine.js View on Github external
var cbag1 = fromArray(a);
var cbag2 = fromArray(a);
var cbag3 = fromArray(a);

var cbagX1 = callbagX.fromArray(a);
var cbagX2 = callbagX.fromArray(a);
var cbagX3 = callbagX.fromArray(a);

var asyncLib1 = asyncLib.fromArray(a)
var asyncLib2 = asyncLib.fromArray(a)
var asyncLib3 = asyncLib.fromArray(a)

var xs1 = xs.fromArray(a);
var xs2 = xs.fromArray(a);
var xs3 = xs.fromArray(a);

var m1 = most.from(a);
var m2 = most.from(a);
var m3 = most.from(a);

var rx1 = rxjs.from(a);
var rx2 = rxjs.from(a);
var rx3 = rxjs.from(a);

suite
    .add('rx5rx-async', function (deferred) {
        runners.runAsync(deferred,
            asyncLib.combineLatest(asyncLib1, asyncLib2, asyncLib3).pipe(map(add3Arr), filter(even)))
    }, options)
    .add('rx4rx-fast', function (deferred) {
        runners.runFast(deferred, callbagX.pipe(
github staltz / callbag-basics / perf / dataflow.js View on Github external
.add('xstream', function (deferred) {
    var source = xs.fromArray(a);
    var inc = source.filter(isPositive).mapTo(+1);
    var dec = source.filter(isNegative).mapTo(-1);
    var count = xs.merge(inc, dec).fold(addXY, 0);
    var label = xs.of('initial', 'Count is ');
    var view = xs.combine(label, count).map(renderWithArray);
    runners.runXStream(deferred, view);
  }, options)
  .add('most', function (deferred) {
github staltz / callbag-basics / perf / filter-map-fusion.js View on Github external
.add('xstream', function(deferred) {
    runners.runXStream(deferred,
      xs.fromArray(a).map(add1).filter(odd).map(add1).map(add1).filter(even).fold(sum, 0).last());
  }, options)
  .add('most', function(deferred) {
github staltz / callbag-basics / perf / combine.js View on Github external
e.currentTarget.failure = e.error;
  }
};

function add3(a, b, c) {
  return a + b + c;
}
function add3Arr(arr) {
  return arr[0] + arr[1] + arr[2];
}

var cbag1 = fromArray(a);
var cbag2 = fromArray(a);
var cbag3 = fromArray(a);

var xs1 = xs.fromArray(a);
var xs2 = xs.fromArray(a);
var xs3 = xs.fromArray(a);

var m1 = most.from(a);
var m2 = most.from(a);
var m3 = most.from(a);

var rx1 = rxjs.Observable.from(a);
var rx2 = rxjs.Observable.from(a);
var rx3 = rxjs.Observable.from(a);

suite
  .add('cb-basics', function(deferred) {
    runners.runCallbag(deferred,
      callbag.pipe(
        callbag.combine(cbag1, cbag2, cbag3),
github staltz / callbag-basics / perf / combine.js View on Github external
};

function add3(a, b, c) {
  return a + b + c;
}
function add3Arr(arr) {
  return arr[0] + arr[1] + arr[2];
}

var cbag1 = fromArray(a);
var cbag2 = fromArray(a);
var cbag3 = fromArray(a);

var xs1 = xs.fromArray(a);
var xs2 = xs.fromArray(a);
var xs3 = xs.fromArray(a);

var m1 = most.from(a);
var m2 = most.from(a);
var m3 = most.from(a);

var rx1 = rxjs.Observable.from(a);
var rx2 = rxjs.Observable.from(a);
var rx3 = rxjs.Observable.from(a);

suite
  .add('cb-basics', function(deferred) {
    runners.runCallbag(deferred,
      callbag.pipe(
        callbag.combine(cbag1, cbag2, cbag3),
        callbag.map(add3Arr),
  callbag.filter(even)