Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE: disable the requirement for having a url, when enabling renderNow in Renderer #9769

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
disable the requirement for having a url, when enabling renderNow in …
…the Renderer
  • Loading branch information
olafbuitelaar committed Apr 5, 2023
commit 8a1b13905d46eb99b66a7106ddd6c6277499f113
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
1 change: 0 additions & 1 deletion test/spec/renderer_spec.js
Original file line number Diff line number Diff line change
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