Comparing version 0.22.0 to 0.23.0
{ | ||
"name": "cerebral", | ||
"version": "0.22.0", | ||
"version": "0.23.0", | ||
"description": "A state controller with its own debugger", | ||
@@ -17,3 +17,3 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"babel-loader": "^5.0.0", | ||
"babel-loader": "^5.3.2", | ||
"cerebral-baobab": "^0.3.1", | ||
@@ -20,0 +20,0 @@ "cerebral-react": "^0.2.0", |
@@ -30,3 +30,5 @@ var utils = require('./utils.js'); | ||
currentSignal = signal; | ||
signalMethodPath.call(null, signal.input); | ||
signalMethodPath(signal.input, { | ||
isRecorded: true | ||
}); | ||
}; | ||
@@ -33,0 +35,0 @@ |
@@ -31,3 +31,3 @@ var utils = require('./utils.js'); | ||
var signalChain = function () { | ||
var signalChain = function (payload, options) { | ||
@@ -44,13 +44,16 @@ if ( | ||
options = options || {}; | ||
if (recorder.isPlaying() && !options.isRecorded) { | ||
return; | ||
} | ||
var tree = staticTree(signalChain.chain); | ||
var actions = tree.actions; | ||
var hasSyncArg = arguments[0] === true; | ||
var runSync = hasSyncArg; | ||
var payload = hasSyncArg ? arguments[1] : arguments[0] | ||
var branches = hasSyncArg ? arguments[2] : arguments[1]; | ||
var runSync = options.isSync; | ||
// When remembering, the branches with filled out values will be | ||
// passed | ||
branches = branches || tree.branches; | ||
var branches = options.branches || tree.branches; | ||
@@ -328,3 +331,3 @@ var runSignal = function () { | ||
signalChain.sync = function (payload) { | ||
signalChain(true, payload); | ||
signalChain(payload, {isSync: true}); | ||
}; | ||
@@ -331,0 +334,0 @@ |
@@ -51,3 +51,3 @@ /* | ||
// Add signal and set the current signal to be the recently added signal | ||
signals.push(signal); | ||
signals.push(signal); | ||
} | ||
@@ -125,3 +125,3 @@ | ||
signalMethodPath.call(null, signal.input, signal.branches); | ||
signalMethodPath(signal.input, {branches: signal.branches}); | ||
currentIndex = x; | ||
@@ -128,0 +128,0 @@ |
@@ -578,3 +578,3 @@ var Controller = require('./../src/index.js'); | ||
test.throws(function () { | ||
ctrl.signals.test(true); | ||
ctrl.signals.test.sync(); | ||
}); | ||
@@ -581,0 +581,0 @@ test.done(); |
@@ -24,6 +24,6 @@ var Controller = require('./../src/index.js'); | ||
test.throws(function () { | ||
ctrl.signals.test(true); | ||
ctrl.signals.test.sync(); | ||
}); | ||
test.throws(function () { | ||
ctrl.signals.test(true, { | ||
ctrl.signals.test.sync({ | ||
foo: 123 | ||
@@ -33,3 +33,3 @@ }); | ||
test.doesNotThrow(function () { | ||
ctrl.signals.test(true, { | ||
ctrl.signals.test.sync({ | ||
foo: 'bar' | ||
@@ -79,3 +79,3 @@ }); | ||
test.throws(function () { | ||
ctrl.signals.test(true); | ||
ctrl.signals.test.sync(); | ||
}); | ||
@@ -102,3 +102,3 @@ test.done(); | ||
test.throws(function () { | ||
ctrl.signals.test(true); | ||
ctrl.signals.test.sync(); | ||
}); | ||
@@ -105,0 +105,0 @@ test.done(); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
2395609
28208
306