Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function run (app, makeDrivers) {
const Time = timeDriver(null, null);
const newMakeDrivers = () => {
const drivers = makeDrivers();
drivers.Time = () => Time;
return drivers;
}
const rerun = rerunner(originalRun, newMakeDrivers);
const stuff = rerun(app);
const awesomeStreams = streamGraph(stuff.sinks);
function InnerApp (sources) {
function restart (setup, main, drivers, cb, {sources, sinks, dispose}, isolate = {}, timeToTravelTo = null) {
dispose();
if (typeof isolate === 'function' && 'reset' in isolate) {
isolate.reset();
}
const realTime = timeDriver();
realTime._pause();
drivers.Time = () => realTime;
for (let driverName in drivers) {
const driver = drivers[driverName];
const newDriver = (sink$) => driver(sink$, realTime);
newDriver.replayLog = driver.replayLog;
newDriver.onPostReplay = driver.onPostReplay;
newDriver.log$ = driver.log$;
drivers[driverName] = newDriver;
if (driver.onPreReplay) {
return function(main, cb = noop, timeToTravelTo = null) {
if (first) {
drivers = driversFn();
let realTime = timeDriver();
drivers.Time = () => realTime;
for (let driverName in drivers) {
const driver = drivers[driverName];
const newDriver = (sink$) => driver(sink$, realTime);
drivers[driverName] = newDriver;
}
const {sources, sinks, run} = Cycle(main, drivers);
realTime = sources.Time;
const dispose = run();