Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
DataflowNoflo.registerGraph = function(graph) {
// Plugin: library
var cl = new noflo.ComponentLoader();
cl.baseDir = graph.baseDir;
cl.listComponents(function(types){
for (name in types) {
cl.load(name, function(component){
makeDataflowNode(name, component);
});
}
});
// Might have to wait for the load callbacks
dataflow.plugins.library.update({
exclude: ["base", "base-resizable", "test", "noflo-base"]
});
// Plugin: source
var sourceChanged = function(graph) {
dataflow.plugins.source.show( JSON.stringify(graph.toJSON(), null, 2) );
exports.register = (server, options, next) => {
const baseDir = options.baseDir;
const rest = _.omit(options, 'baseDir');
const loader = new NoFlo.ComponentLoader(baseDir, rest);
loader.listComponents(() => {
Object
.keys(loader.components)
.forEach((componentName) => {
loader
.load(componentName, (err, component) => {
if (err) {
return next(err);
}
component
.start((err) => {
if (err) {
beforeEach(function(done) {
this.timeout(10000);
var loader = new noflo.ComponentLoader('/noflo-react');
loader.load('react/Render', function(err, instance) {
if (err) { return done(err); }
c = instance;
c.once('ready', function () {
module = noflo.internalSocket.createSocket();
container = noflo.internalSocket.createSocket();
props = noflo.internalSocket.createSocket();
event = noflo.internalSocket.createSocket();
error = noflo.internalSocket.createSocket();
c.inPorts.module.attach(module);
c.inPorts.container.attach(container);
c.inPorts.props.attach(props);
c.outPorts.event.attach(event);
c.outPorts.error.attach(error);
c.start(done);
});
before(function (done) {
this.timeout(4000);
const loader = new noflo.ComponentLoader(baseDir);
loader.load('core/Copy', (err, instance) => {
if (err) {
done(err);
return;
}
c = instance;
ins = noflo.internalSocket.createSocket();
c.inPorts.in.attach(ins);
done();
});
});
beforeEach(() => {
beforeEach(function (done) {
this.timeout(4000);
const loader = new noflo.ComponentLoader(baseDir);
loader.load('core/ReadGlobal', (err, instance) => {
if (err) {
done(err);
return;
}
c = instance;
done();
});
});
before(function (done) {
this.timeout(4000);
const loader = new noflo.ComponentLoader(baseDir);
loader.load('core/Callback', (e, instance) => {
if (e) {
done(e);
return;
}
c = instance;
ins = noflo.internalSocket.createSocket();
cb = noflo.internalSocket.createSocket();
c.inPorts.in.attach(ins);
c.inPorts.callback.attach(cb);
done();
});
});
beforeEach(() => {
before(function (done) {
this.timeout(4000);
const loader = new noflo.ComponentLoader(baseDir);
loader.load('core/Drop', (err, instance) => {
if (err) {
done(err);
return;
}
c = instance;
ins = noflo.internalSocket.createSocket();
c.inPorts.in.attach(ins);
done();
});
});
before(function (done) {
this.timeout(4000);
const loader = new noflo.ComponentLoader(baseDir);
loader.load('core/RunInterval', (err, instance) => {
if (err) {
done(err);
return;
}
c = instance;
interval = noflo.internalSocket.createSocket();
c.inPorts.interval.attach(interval);
start = noflo.internalSocket.createSocket();
c.inPorts.start.attach(start);
stop = noflo.internalSocket.createSocket();
c.inPorts.stop.attach(stop);
done();
});
});
beforeEach(() => {
before(function (done) {
this.timeout(4000);
if (noflo.isBrowser()) {
this.skip();
return;
}
const loader = new noflo.ComponentLoader(baseDir);
loader.load('core/ReadEnv', (e, instance) => {
if (e) {
done(err);
return;
}
c = instance;
key = noflo.internalSocket.createSocket();
c.inPorts.key.attach(key);
done();
});
});
beforeEach(() => {
before(function (done) {
this.timeout(4000);
const loader = new noflo.ComponentLoader(baseDir);
loader.load('core/RunTimeout', (err, instance) => {
if (err) {
done(err);
return;
}
c = instance;
start = noflo.internalSocket.createSocket();
c.inPorts.start.attach(start);
time = noflo.internalSocket.createSocket();
c.inPorts.time.attach(time);
done();
});
});
beforeEach(() => {