Comparing version 0.20.11 to 0.20.12
{ | ||
"name": "cerebral", | ||
"version": "0.20.11", | ||
"version": "0.20.12", | ||
"description": "A state controller with its own debugger", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -5,2 +5,3 @@ var utils = require('./utils.js'); | ||
var currentSignal = null; | ||
var currentSeek = 0; | ||
@@ -29,7 +30,4 @@ var currentRecording = null; | ||
} | ||
if (isCatchingUp) { | ||
signalMethodPath.call(null, signal.input, signal.branches); | ||
} else { | ||
signalMethodPath.call(null, signal.input); | ||
} | ||
currentSignal = signal; | ||
signalMethodPath.call(null, signal.input); | ||
}; | ||
@@ -61,2 +59,6 @@ | ||
getCurrentSignal: function () { | ||
return currentSignal; | ||
}, | ||
createTimer: function () { | ||
@@ -79,2 +81,3 @@ var update = function () { | ||
play: function () { | ||
if (isPlaying || isRecording) { | ||
@@ -81,0 +84,0 @@ throw new Error('CEREBRAL Recorder - You can not play while already playing or recording'); |
@@ -27,4 +27,2 @@ var utils = require('./utils.js'); | ||
if (utils.isDeveloping()) { | ||
@@ -66,2 +64,9 @@ analyze(signalName, chain); | ||
var start = Date.now(); | ||
var recorderSignal = { | ||
name: signalName, | ||
input: payload, | ||
start: start, | ||
asyncActionPaths: [], | ||
asyncActionResults: [] | ||
}; | ||
var signal = { | ||
@@ -82,3 +87,3 @@ name: signalName, | ||
if (recorder.isRecording()) { | ||
recorder.addSignal(signal); | ||
recorder.addSignal(recorderSignal); | ||
} | ||
@@ -88,3 +93,2 @@ | ||
var runBranch = function (branch, index, start) { | ||
@@ -128,2 +132,17 @@ | ||
} else if (recorder.isCatchingUp()) { | ||
var currentSignal = recorder.getCurrentSignal(); | ||
currentBranch.forEach(function (action) { | ||
var recordedAction = currentSignal.asyncActionResults[currentSignal.asyncActionPaths.indexOf(action.path.join('.'))]; | ||
utils.merge(signalArgs, recordedAction.output); | ||
if (action.outputPath) { | ||
runBranch(action.outputs[recordedAction.outputPath], 0); | ||
} | ||
}); | ||
runBranch(branch, index + 1); | ||
} else { | ||
@@ -157,2 +176,11 @@ | ||
signalStore.removeAsyncAction(); | ||
if (recorder.isRecording()) { | ||
recorderSignal.asyncActionPaths.push(action.path.join('.')); | ||
recorderSignal.asyncActionResults.push({ | ||
output: result.arg, | ||
outputPath: result.path | ||
}); | ||
} | ||
if (result.path) { | ||
@@ -159,0 +187,0 @@ action.outputPath = result.path; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2384477
28082