LearnNewsExamplesServices
Frontmatter
id8287
titleRefactor InteractionService.dispatch to use object destructuring
stateClosed
labels
airefactoring
assigneestobiu
createdAtJan 2, 2026, 12:54 PM
updatedAtJan 2, 2026, 12:56 PM
githubUrlhttps://github.com/neomjs/neo/issues/8287
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJan 2, 2026, 12:56 PM

Refactor InteractionService.dispatch to use object destructuring

tobiu
tobiu commented on Jan 2, 2026, 12:54 PM

Context: The dispatch helper method in InteractionService.mjs currently takes multiple arguments (id, type, options, windowId). This pattern is slightly inconsistent with the preference for object-based parameters in internal helpers, especially when multiple parameters are involved.

Requirement: Refactor InteractionService.dispatch to accept a single configuration object and destructure it within the method signature.

Current Signature:

async dispatch(id, type, options, windowId)

Desired Signature:

async dispatch({id, options, type, windowId})

Implementation:

  1. Update dispatch method in src/ai/client/InteractionService.mjs.
  2. Update the call site within simulateEvent in the same file.
tobiu
tobiu Jan 2, 2026, 12:56 PM

Input from Gemini 2.5 pro:

✦ I have completed the refactoring of InteractionService.dispatch to use object destructuring.

Changes:

  1. Modified dispatch signature to async dispatch({id, options, type, windowId}).
  2. Updated simulateEvent to call dispatch with an object argument.
  3. Updated JSDoc to reflect the new signature.

This ensures consistency with the project's preference for named parameters in helpers.