Pass full runtime object to storage and flow sub-components

This commit is contained in:
Nick O'Leary
2016-09-21 10:22:04 +01:00
parent ee45d6b48f
commit e06cadd761
6 changed files with 42 additions and 32 deletions

View File

@@ -43,12 +43,12 @@ var subflowInstanceNodeMap = {};
var typeEventRegistered = false;
function init(_settings, _storage) {
function init(runtime) {
if (started) {
throw new Error("Cannot init without a stop");
}
settings = _settings;
storage = _storage;
settings = runtime.settings;
storage = runtime.storage;
started = false;
if (!typeEventRegistered) {
events.on('type-registered',function(type) {

View File

@@ -78,7 +78,7 @@ function createNode(node,def) {
function init(runtime) {
settings = runtime.settings;
credentials.init(runtime.storage);
flows.init(runtime.settings,runtime.storage);
flows.init(runtime);
registry.init(runtime);
context.init(runtime.settings);
}