Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prototype.evaluate = async function(encode, prerun, postrun) {
// evaluate dataflow and prerun
await Dataflow.prototype.evaluate.call(this, encode, prerun);
// render as needed
if (this._redraw || this._resize) {
try {
if (this._renderer) {
if (this._resize) {
this._resize = 0;
resizeRenderer(this);
}
await this._renderer.renderAsync(this._scenegraph.root);
}
this._redraw = false;
} catch (e) {
this.error(e);
}
}
prototype.evaluate = async function(encode, prerun, postrun) {
// evaluate dataflow and prerun
await Dataflow.prototype.evaluate.call(this, encode, prerun);
// render as needed
if (this._redraw || this._resize) {
try {
if (this._renderer) {
if (this._resize) {
this._resize = 0;
resizeRenderer(this);
}
await this._renderer.renderAsync(this._scenegraph.root);
}
this._redraw = false;
} catch (e) {
this.error(e);
}
}
prototype.run = function() {
Dataflow.prototype.run.call(this);
if (!this._queue || this._queue.length) {
this.render(this._queue);
this._queue = [];
}
return this;
};
prototype.loader = function(loader) {
if (!arguments.length) return this._loader;
if (loader !== this._loader) {
Dataflow.prototype.loader.call(this, loader);
this._resetRenderer();
}
return this;
};
prototype.loader = function(loader) {
if (!arguments.length) return this._loader;
if (loader !== this._loader) {
Dataflow.prototype.loader.call(this, loader);
if (this._renderer) {
this._renderer = null;
this.initialize(this._el);
}
}
return this;
};
prototype.run = function() {
var numOps = Dataflow.prototype.run.call(this);
if (numOps && (!this._queue || this._queue.length)) {
this.render(this._queue);
this._queue = [];
}
return this;
};
prototype.loader = function(loader) {
if (!arguments.length) return this._loader;
if (loader !== this._loader) {
Dataflow.prototype.loader.call(this, loader);
this._resetRenderer();
}
return this;
};
prototype.run = function(encode) {
Dataflow.prototype.run.call(this, encode);
if (this._redraw || this._resize) {
try {
this.render();
} catch (e) {
this.error(e);
}
}
return this;
};