How to use the @cycle/run function in @cycle/run

To help you get started, we’ve selected a few @cycle/run 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 / cycle-onionify / examples / basic / src / main.js View on Github external
const updateReducer$ = action$.map(num => function updateReducer(prevState) {
    return {count: prevState.count + num};
  });

  const reducer$ = xs.merge(initReducer$, updateReducer$);

  return {
    DOM: vdom$,
    onion: reducer$,
  };
}

const wrappedMain = onionify(main);

run(wrappedMain, {
  DOM: makeDOMDriver('#main-container')
});

@cycle/run

The Cycle.js run() function to use with xstream

MIT
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis