16 lines
240 B
TypeScript
Raw Normal View History

2022-08-13 12:11:59 -05:00
import { joinRoom } from 'trystero'
export class PeerRoom {
room: any
2022-08-14 10:10:05 -05:00
joinRoom(appId: string, roomId: string) {
this.room = joinRoom({ appId }, roomId)
2022-08-13 12:11:59 -05:00
}
leaveRoom() {
if (this.room) {
this.room.leave()
}
}
}