How to use the @cycle/run.setup 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 cyclejs / react / src / convert.ts View on Github external
return makeCycleReactComponent<p>(() =&gt; {
      const program = setup(main, {
        ...(drivers as object),
        [channel]: () =&gt; new ReactSource(),
      } as any);
      const source: ReactSource = program.sources[channel];
      const sink = program.sinks[channel];
      const events = {...(program.sinks as object)};
      delete events[channel];
      for (let name in events) {
        if (name in drivers) delete events[name];
      }
      const dispose = program.run();
      return {source, sink, events, dispose};
    });
  } else {</p>
github cyclejs / cyclejs / most-run / src / index.ts View on Github external
export function setup&lt;
  D extends MatchingDrivers,
  M extends MatchingMain
&gt;(main: M, drivers: D): CycleProgram {
  return coreSetup(main, drivers as any) as any;
}
github cyclejs / cycle-time-travel / src / time-travel.ts View on Github external
ChangeTime: changeTime$.map(stream => stream.last()).flatten()
    }
  }

  const innerDrivers = {
    DOM: makeDOMDriver('.tools'),
    ChangeTime: (stream) => {
      stream.addListener({
        next (ev) {
          rerun(app, () => {}, Time['_time']() - ev * 10);
        }
      });
    }
  }

  originalRun(InnerApp, innerDrivers).run();
}
github cyclejs / cyclejs / most-run / src / index.ts View on Github external
export function run&lt;
  D extends MatchingDrivers,
  M extends MatchingMain
&gt;(main: M, drivers: D): DisposeFunction {
  const program = coreSetup(main, drivers as any);
  return program.run();
}
github cyclejs / cyclejs / rxjs-run / src / index.ts View on Github external
export function setup&lt;
  D extends MatchingDrivers,
  M extends MatchingMain
&gt;(main: M, drivers: D): CycleProgram {
  return coreSetup(main, drivers as any) as any;
}
github cyclejs / cyclejs / rxjs-run / src / index.ts View on Github external
export function run&lt;
  D extends MatchingDrivers,
  M extends MatchingMain
&gt;(main: M, drivers: D): DisposeFunction {
  const program = coreSetup(main, drivers as any);
  return program.run();
}

@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