@instantdb/core
Advanced tools
Comparing version 0.10.11 to 0.10.13
@@ -61,5 +61,3 @@ import Reactor from "./Reactor"; | ||
declare function init<Schema = {}, RoomSchema extends RoomSchemaShape = {}>(config: Config, Storage?: any, NetworkListener?: any): InstantCore<Schema, RoomSchema>; | ||
declare class InstantCore<Schema = {}, RoomSchema extends RoomSchemaShape = { | ||
[k: string]: any; | ||
}> { | ||
declare class InstantCore<Schema = {}, RoomSchema extends RoomSchemaShape = {}> { | ||
_reactor: Reactor<RoomSchema>; | ||
@@ -136,3 +134,3 @@ auth: Auth; | ||
*/ | ||
joinRoom<RoomType extends keyof RoomSchema>(roomType: RoomType, roomId: string): RoomHandle<RoomSchema[RoomType]["presence"], RoomSchema[RoomType]["topics"]>; | ||
joinRoom<RoomType extends keyof RoomSchema>(roomType?: RoomType, roomId?: string): RoomHandle<RoomSchema[RoomType]["presence"], RoomSchema[RoomType]["topics"]>; | ||
shutdown(): void; | ||
@@ -139,0 +137,0 @@ } |
@@ -150,3 +150,3 @@ "use strict"; | ||
*/ | ||
joinRoom(roomType, roomId) { | ||
joinRoom(roomType = '_defaultRoomType', roomId = '_defaultRoomId') { | ||
const leaveRoom = this._reactor.joinRoom(roomId); | ||
@@ -153,0 +153,0 @@ return { |
@@ -61,5 +61,3 @@ import Reactor from "./Reactor"; | ||
declare function init<Schema = {}, RoomSchema extends RoomSchemaShape = {}>(config: Config, Storage?: any, NetworkListener?: any): InstantCore<Schema, RoomSchema>; | ||
declare class InstantCore<Schema = {}, RoomSchema extends RoomSchemaShape = { | ||
[k: string]: any; | ||
}> { | ||
declare class InstantCore<Schema = {}, RoomSchema extends RoomSchemaShape = {}> { | ||
_reactor: Reactor<RoomSchema>; | ||
@@ -136,3 +134,3 @@ auth: Auth; | ||
*/ | ||
joinRoom<RoomType extends keyof RoomSchema>(roomType: RoomType, roomId: string): RoomHandle<RoomSchema[RoomType]["presence"], RoomSchema[RoomType]["topics"]>; | ||
joinRoom<RoomType extends keyof RoomSchema>(roomType?: RoomType, roomId?: string): RoomHandle<RoomSchema[RoomType]["presence"], RoomSchema[RoomType]["topics"]>; | ||
shutdown(): void; | ||
@@ -139,0 +137,0 @@ } |
@@ -137,3 +137,3 @@ import Reactor from "./Reactor"; | ||
*/ | ||
joinRoom(roomType, roomId) { | ||
joinRoom(roomType = '_defaultRoomType', roomId = '_defaultRoomId') { | ||
const leaveRoom = this._reactor.joinRoom(roomId); | ||
@@ -140,0 +140,0 @@ return { |
{ | ||
"name": "@instantdb/core", | ||
"version": "0.10.11", | ||
"version": "0.10.13", | ||
"description": "Instant's core local abstraction", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -136,4 +136,4 @@ import Reactor from "./Reactor"; | ||
Schema = {}, | ||
RoomSchema extends RoomSchemaShape = { [k: string]: any }, | ||
> { | ||
RoomSchema extends RoomSchemaShape = {}, | ||
> { | ||
public _reactor: Reactor<RoomSchema>; | ||
@@ -230,4 +230,4 @@ public auth: Auth; | ||
joinRoom<RoomType extends keyof RoomSchema>( | ||
roomType: RoomType, | ||
roomId: string, | ||
roomType: RoomType = '_defaultRoomType' as RoomType, | ||
roomId: string = '_defaultRoomId', | ||
): RoomHandle< | ||
@@ -234,0 +234,0 @@ RoomSchema[RoomType]["presence"], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1594542
207
16
1
194
2664
35758
37