LearnNewsExamplesServices
Frontmatter
id8792
titleRefactor Portal.canvas.Base: Extract checkCanvas to class method
stateClosed
labels
airefactoring
assigneestobiu
createdAtJan 19, 2026, 1:49 AM
updatedAtJan 19, 2026, 1:52 AM
githubUrlhttps://github.com/neomjs/neo/issues/8792
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJan 19, 2026, 1:52 AM

Refactor Portal.canvas.Base: Extract checkCanvas to class method

tobiu
tobiu commented on Jan 19, 2026, 1:49 AM

To improve code readability, testability, and adherence to project conventions, the inline checkCanvas function within Portal.canvas.Base.initGraph should be refactored into a protected class method waitForCanvas.

Changes:

  1. Extract checkCanvas logic into waitForCanvas(canvasId, windowId, hasChange).
  2. Update initGraph to call this.waitForCanvas.
  3. Ensure polling mechanism uses bind or arrow functions to maintain scope.
tobiu
tobiu Jan 19, 2026, 1:52 AM

Input from Gemini 3 Pro:

✦ Refactored initGraph to use a protected waitForCanvas method. This improves readability and allows subclasses to potentially hook into the canvas waiting logic.