Skip to content

Commit

Permalink
Merge pull request #143 from terje-andre-johansen/master
Browse files Browse the repository at this point in the history
Added a generic to Room.ts send method
  • Loading branch information
endel authored Jun 12, 2024
2 parents 1f1736b + 7afe437 commit 7ccac31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class Room<State= any> {
return this.onMessageHandlers.on(this.getMessageHandlerKey(type), callback);
}

public send(type: string | number, message?: any): void {
public send<T = any>(type: string | number, message?: T): void {
const initialBytes: number[] = [Protocol.ROOM_DATA];

if (typeof(type) === "string") {
Expand Down

0 comments on commit 7ccac31

Please sign in to comment.