diff --git a/src/Renderer.js b/src/Renderer.js index cdee9c79e63..2f9b2e025cb 100644 --- a/src/Renderer.js +++ b/src/Renderer.js @@ -22,6 +22,7 @@ export function Renderer(options) { this.config = config; this.handlers = {}; this.id = id; + this.renderNow = renderNow; // a renderer may push to the command queue to delay rendering until the // render function is loaded by loadExternalScript, at which point the the command @@ -110,7 +111,7 @@ Renderer.prototype.process = function() { * @returns {Boolean} */ export function isRendererRequired(renderer) { - return !!(renderer && renderer.url); + return !!(renderer && (renderer.url || renderer.renderNow)); } /** diff --git a/test/spec/renderer_spec.js b/test/spec/renderer_spec.js index c41334f916a..fb1e25d6009 100644 --- a/test/spec/renderer_spec.js +++ b/test/spec/renderer_spec.js @@ -52,7 +52,7 @@ describe('Renderer', function () { expect(testRenderer2.getConfig()).to.deep.equal({ test: 'config2' }); }); - it('sets a render function with setRender method', function () { + it('sets a render function with the setRender method', function () { testRenderer1.setRender(spyRenderFn); expect(typeof testRenderer1.render).to.equal('function'); testRenderer1.render(); @@ -110,7 +110,6 @@ describe('Renderer', function () { it('renders immediately when requested', function () { const testRenderer3 = Renderer.install({ - url: 'https://httpbin.org/post', config: { test: 'config2' }, id: 2, renderNow: true