Comparing version 5.0.0-1528907706035 to 5.0.0-1530304999843
@@ -63,3 +63,3 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
_this.version = "5.0.0-1528907706035"; | ||
_this.version = "5.0.0-1530304999843"; | ||
_this.debuggerWatchMap = {}; | ||
@@ -66,0 +66,0 @@ _this.debuggerComputedMap = {}; |
@@ -8,5 +8,8 @@ export { _runSequence as runSequence }; | ||
import { Path, Primitive } from 'function-tree'; | ||
import { Controller, Module, state } from '..'; | ||
import { ensurePath, cleanPath } from '../utils'; | ||
import { cleanPath, ensurePath } from '../utils'; | ||
import Controller from '../Controller'; | ||
import Module from '../Module'; | ||
import { state } from '..'; | ||
export { default as Snapshot } from './snapshot'; | ||
@@ -18,3 +21,3 @@ | ||
var response = void 0; | ||
var rootModule = Module({ | ||
var rootModule = new Module({ | ||
state: Object.assign(fixtures.state || {}, { compute: compute }), | ||
@@ -29,3 +32,3 @@ sequences: { | ||
}); | ||
var controller = Controller(rootModule); | ||
var controller = new Controller(rootModule); | ||
controller.getSequence('test')(fixtures.props); | ||
@@ -43,3 +46,3 @@ | ||
var isSequence = Array.isArray(sequence) || sequence instanceof Primitive; | ||
var controller = options.controller || Controller(Module(Object.assign({}, fixtures, isSequence && { sequences: { sequence: sequence } }))); | ||
var controller = options.controller || new Controller(new Module(Object.assign({}, fixtures, isSequence && { sequences: { sequence: sequence } }))); | ||
var response = { controller: controller }; | ||
@@ -101,7 +104,9 @@ | ||
var controller = Controller(rootModule, options); | ||
var controller = new Controller(rootModule, options); | ||
var model = controller.getModel(); | ||
return { | ||
controller: controller, | ||
runSequence: function runSequence(sequence, props) { | ||
runSequence: function runSequence(sequence) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return _runSequence(sequence, { props: props }, Object.assign({}, options, { controller: controller, noDuplicateWarnings: true })); | ||
@@ -108,0 +113,0 @@ }, |
@@ -166,3 +166,3 @@ import { DevTools } from './devtools'; | ||
export function Controller(rootModule: ModuleClass, config?: ControllerOptions): ControllerClass; | ||
export function Controller(rootModule: ModuleClass | ModuleDefinition, config?: ControllerOptions): ControllerClass; | ||
@@ -169,0 +169,0 @@ export default function App(rootModule: ModuleClass | ModuleDefinition, config?: ControllerOptions): ControllerClass; |
@@ -81,3 +81,3 @@ 'use strict'; | ||
_this.version = "5.0.0-1528907706035"; | ||
_this.version = "5.0.0-1530304999843"; | ||
_this.debuggerWatchMap = {}; | ||
@@ -84,0 +84,0 @@ _this.debuggerComputedMap = {}; |
@@ -24,6 +24,14 @@ 'use strict'; | ||
var _utils = require('../utils'); | ||
var _Controller = require('../Controller'); | ||
var _Controller2 = _interopRequireDefault(_Controller); | ||
var _Module = require('../Module'); | ||
var _Module2 = _interopRequireDefault(_Module); | ||
var _ = require('..'); | ||
var _utils = require('../utils'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -37,3 +45,3 @@ | ||
var response = void 0; | ||
var rootModule = (0, _.Module)({ | ||
var rootModule = new _Module2.default({ | ||
state: Object.assign(fixtures.state || {}, { compute: compute }), | ||
@@ -48,3 +56,3 @@ sequences: { | ||
}); | ||
var controller = (0, _.Controller)(rootModule); | ||
var controller = new _Controller2.default(rootModule); | ||
controller.getSequence('test')(fixtures.props); | ||
@@ -62,3 +70,3 @@ | ||
var isSequence = Array.isArray(sequence) || sequence instanceof _functionTree.Primitive; | ||
var controller = options.controller || (0, _.Controller)((0, _.Module)(Object.assign({}, fixtures, isSequence && { sequences: { sequence: sequence } }))); | ||
var controller = options.controller || new _Controller2.default(new _Module2.default(Object.assign({}, fixtures, isSequence && { sequences: { sequence: sequence } }))); | ||
var response = { controller: controller }; | ||
@@ -121,7 +129,9 @@ | ||
var controller = (0, _.Controller)(rootModule, options); | ||
var controller = new _Controller2.default(rootModule, options); | ||
var model = controller.getModel(); | ||
return { | ||
controller: controller, | ||
runSequence: function runSequence(sequence, props) { | ||
runSequence: function runSequence(sequence) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return _runSequence(sequence, { props: props }, Object.assign({}, options, { controller: controller, noDuplicateWarnings: true })); | ||
@@ -128,0 +138,0 @@ }, |
{ | ||
"name": "cerebral", | ||
"version": "5.0.0-1528907706035", | ||
"version": "5.0.0-1530304999843", | ||
"description": "A state controller with its own debugger", | ||
@@ -24,3 +24,3 @@ "main": "index.js", | ||
"es6-error": "^4.0.2", | ||
"function-tree": "^3.3.0-1528907706035" | ||
"function-tree": "^3.3.0-1530304999843" | ||
}, | ||
@@ -27,0 +27,0 @@ "scripts": { |
import { | ||
BaseControllerClass, | ||
Compute, | ||
ControllerOptions, | ||
ModuleClass, | ||
BaseControllerClass, | ||
ModuleDefinition, | ||
Sequence, | ||
ControllerOptions, | ||
ModuleDefinition, | ||
} from '../' | ||
@@ -81,3 +81,3 @@ | ||
controller: BaseControllerClass | ||
runSignal<T = any>(signal: Sequence, props: any): Promise<T> | ||
runSequence<T = any>(sequence: Sequence | string, props?: any): Promise<T> | ||
setState(path: string, value: any): void | ||
@@ -88,4 +88,4 @@ getState(path: string): any | ||
export function CerebralTest( | ||
fixtures: ControllerOptions, | ||
rootModule: ModuleClass | ModuleDefinition, | ||
options?: any | ||
): CerebralTestType |
Sorry, the diff of this file is not supported yet
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
773792
7700