Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return makeCycleReactComponent<p>(() => {
const program = setup(main, {
...(drivers as object),
[channel]: () => 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>
export function setup<
D extends MatchingDrivers,
M extends MatchingMain
>(main: M, drivers: D): CycleProgram {
return coreSetup(main, drivers as any) as any;
}
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();
}
export function run<
D extends MatchingDrivers,
M extends MatchingMain
>(main: M, drivers: D): DisposeFunction {
const program = coreSetup(main, drivers as any);
return program.run();
}
export function setup<
D extends MatchingDrivers,
M extends MatchingMain
>(main: M, drivers: D): CycleProgram {
return coreSetup(main, drivers as any) as any;
}
export function run<
D extends MatchingDrivers,
M extends MatchingMain
>(main: M, drivers: D): DisposeFunction {
const program = coreSetup(main, drivers as any);
return program.run();
}