How to use the most.Stream function in most

To help you get started, we’ve selected a few most 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 mathieuancelin / js-repaint-perfs / motorcycle / node_modules / most-subject / lib / index.js View on Github external
function create(replay, bufferSize, initialValue) {
  var sink = new _Subscription.Subscription();
  var stream = undefined;

  if (!replay) {
    stream = new _most.Stream(new _MulticastSource2.default(sink));
  } else {
    stream = bufferSize === 1 ? (0, _hold2.default)(new _most.Stream(sink)) : (0, _ReplaySource.replay)(new _most.Stream(sink), bufferSize);
  }

  stream.drain();

  if (typeof initialValue !== 'undefined') {
    sink.next(initialValue);
  }

  return { sink: sink, stream: stream, observer: sink };
}
github mathieuancelin / js-repaint-perfs / motorcycle / node_modules / @motorcycle / core / node_modules / most-subject / lib / subject.js View on Github external
function create() {
  var sink = new Subscription();
  var stream = new _most.Stream(new _MulticastSource2.default(sink));
  return { sink: sink, stream: stream };
}
github mathieuancelin / js-repaint-perfs / motorcycle / node_modules / most-subject / lib / index.js View on Github external
function create(replay, bufferSize, initialValue) {
  var sink = new _Subscription.Subscription();
  var stream = undefined;

  if (!replay) {
    stream = new _most.Stream(new _MulticastSource2.default(sink));
  } else {
    stream = bufferSize === 1 ? (0, _hold2.default)(new _most.Stream(sink)) : (0, _ReplaySource.replay)(new _most.Stream(sink), bufferSize);
  }

  stream.drain();

  if (typeof initialValue !== 'undefined') {
    sink.next(initialValue);
  }

  return { sink: sink, stream: stream, observer: sink };
}
github batata-frita / redux-heat / src / createStateStream.js View on Github external
export default function createStateStream(store) {
  return new Stream({
    run: (sink, scheduler) => {
      const unsubscribe = store.subscribe(() => {
        sink.event(scheduler.now(), store.getState())
      })

      return {
        dispose: () => unsubscribe(),
      }
    },
  })
}
github mostjs-community / subject / src / behaviorSubject.js View on Github external
function create(initialValue) {
  const sink = new BehaviorSubscription(initialValue)
  const stream = new Stream(new MulticastSource(sink))
  const holdStream = hold(stream)
  holdStream.drain()
  return {sink, stream: holdStream}
}
github mostjs / sample / src / index.js View on Github external
export const sample = curry3((f, sampler, stream) =>
  new Stream(new SampleSource(f, sampler, stream)))
github mostjs / dom-event / src / index.js View on Github external
export const domEvent = (event, node, capture = false) =>
  new Stream(new DomEvent(event, node, capture))