Skip to content

Commit

Permalink
CORE: disable the requirement for having a url, when enabling renderN…
Browse files Browse the repository at this point in the history
…ow in Renderer (#9769)

* disable the requirement for having a url, when enabling renderNow in the Renderer

* kick off circleci

---------

Co-authored-by: Chris Huie <[email protected]>
  • Loading branch information
olafbuitelaar and ChrisHuie authored Apr 13, 2023
1 parent db9bc3c commit f7c2c34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -110,7 +111,7 @@ Renderer.prototype.process = function() {
* @returns {Boolean}
*/
export function isRendererRequired(renderer) {
return !!(renderer && renderer.url);
return !!(renderer && (renderer.url || renderer.renderNow));
}

/**
Expand Down
3 changes: 1 addition & 2 deletions test/spec/renderer_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f7c2c34

Please sign in to comment.