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
blockedBy[]
blocking[]
closedAtJan 2, 2026, 12:56 PM

Refactor InteractionService.dispatch to use object destructuring

Closed v11.18.0 airefactoring
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 added the good first issue label on Jan 2, 2026, 12:54 PM
tobiu added the ai label on Jan 2, 2026, 12:54 PM
tobiu added the refactoring label on Jan 2, 2026, 12:54 PM
tobiu assigned to @tobiu on Jan 2, 2026, 12:54 PM
tobiu removed the good first issue label on Jan 2, 2026, 12:54 PM
tobiu referenced in commit e75a4be - "Refactor InteractionService.dispatch to use object destructuring #8287" on Jan 2, 2026, 12:55 PM
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.

tobiu closed this issue on Jan 2, 2026, 12:56 PM