Skip to content

Commit e75a4be

Browse files
committed
Refactor InteractionService.dispatch to use object destructuring #8287
1 parent e34a877 commit e75a4be

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/ai/client/InteractionService.mjs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,27 @@ class InteractionService extends Service {
3434
await me.timeout(event.delay)
3535
}
3636

37-
await me.dispatch(event.targetId, event.type, event.options, event.windowId)
37+
await me.dispatch({
38+
id : event.targetId,
39+
options : event.options,
40+
type : event.type,
41+
windowId: event.windowId
42+
})
3843
}
3944

4045
return true
4146
}
4247

4348
/**
4449
* Helper to dispatch a single event to the correct window
45-
* @param {String} id
46-
* @param {String} type
47-
* @param {Object} options
48-
* @param {String} windowId
50+
* @param {Object} data
51+
* @param {String} data.id
52+
* @param {Object} data.options
53+
* @param {String} data.type
54+
* @param {String} data.windowId
4955
* @returns {Promise<Boolean>}
5056
*/
51-
async dispatch(id, type, options, windowId) {
57+
async dispatch({id, options, type, windowId}) {
5258
await Neo.Main.importAddon({name: 'EventSimulator', windowId});
5359

5460
return await Neo.main.addon.EventSimulator.dispatch({

0 commit comments

Comments
 (0)