@roomservice/browser
Advanced tools
Comparing version 0.4.0-9 to 0.4.0-10
@@ -6,2 +6,3 @@ import RoomClient from "./room-client"; | ||
private readonly _headers?; | ||
private readonly _roomPool; | ||
constructor(parameters: { | ||
@@ -8,0 +9,0 @@ authUrl: string; |
@@ -7,2 +7,3 @@ "use strict"; | ||
constructor(parameters) { | ||
this._roomPool = {}; | ||
this._authorizationUrl = parameters.authUrl; | ||
@@ -12,3 +13,6 @@ this._headers = parameters.headers; | ||
room(roomReference, defaultDoc) { | ||
return new room_client_1.default({ | ||
if (this._roomPool[roomReference]) { | ||
return this._roomPool[roomReference]; | ||
} | ||
const room = new room_client_1.default({ | ||
authUrl: this._authorizationUrl, | ||
@@ -19,2 +23,4 @@ roomReference, | ||
}); | ||
this._roomPool[roomReference] = room; | ||
return room; | ||
} | ||
@@ -21,0 +27,0 @@ } |
{ | ||
"name": "@roomservice/browser", | ||
"version": "0.4.0-9", | ||
"version": "0.4.0-10", | ||
"main": "dist/index", | ||
@@ -5,0 +5,0 @@ "types": "dist/index", |
Sorry, the diff of this file is not supported yet
64181
997