How to use the cyclejs.Rx.BehaviorSubject function in cyclejs

To help you get started, we’ve selected a few cyclejs 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 staltz / rxmarbles / src / components / sandbox / sandbox-output.js View on Github external
function getDiagramPromise(stream, scheduler) {
  let diagram = {};
  let subject = new Rx.BehaviorSubject([]);
  stream
    .observeOn(scheduler)
    .timestamp(scheduler)
    .map(x => {
      if (typeof x.value !== 'object') {
        x.value = Immutable.Map({
          content: x.value,
          id: Utils.calculateNotificationContentHash(x.value)
        });
      }
      // converts timestamp to % of MAX_VT_TIME
      return x.value.set('time', (x.timestamp / MAX_VT_TIME) * 100);
    })
    .reduce((acc, x) => {
      acc.push(x);
      return acc;