Skip to content

Commit

Permalink
feat(insim): pass the InSim instance in InSim "connect" and "disconne…
Browse files Browse the repository at this point in the history
…ct" event callbacks
  • Loading branch information
mkapal committed Apr 30, 2023
1 parent b407cdc commit 4a488c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/InSim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ export class InSim extends TypedEmitter<InSimEvents> {
}),
);
}
this.emit('connect');
this.emit('connect', this);
});

this.connection.on('disconnect', () => {
this.emit('disconnect');
this.emit('disconnect', this);
});

this.connection.on('error', (error: Error) => {
Expand Down
4 changes: 2 additions & 2 deletions src/InSimEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ export type InSimPacketEvents = {
};

export type InSimEvents = InSimPacketEvents & {
connect: () => void;
disconnect: () => void;
connect: (inSim: InSim) => void;
disconnect: (inSim: InSim) => void;
};

0 comments on commit 4a488c0

Please sign in to comment.