TLSocketRoomOptions

See source code
Table of contents

Base options for TLSocketRoom.

interface TLSocketRoomOptions<R extends UnknownRecord, SessionMeta> {}

Properties

clientTimeout

optional
clientTimeout?: number

initialSnapshot

optional

Deprecated: use the storage option instead

initialSnapshot?: RoomSnapshot | TLStoreSnapshot

log

optional
log?: TLSyncLog

onAfterReceiveMessage

optional
onAfterReceiveMessage?: (args: {
  message: TLSocketServerSentEvent<R>
  meta: SessionMeta
  sessionId: string
  stringified: string
}) => void

onBeforeSendMessage

optional
onBeforeSendMessage?: (args: {
  message: TLSocketServerSentEvent<R>
  meta: SessionMeta
  sessionId: string
  stringified: string
}) => void

onSessionRemoved

optional
onSessionRemoved?: (
  room: TLSocketRoom<R, SessionMeta>,
  args: {
    meta: SessionMeta
    numSessionsRemaining: number
    sessionId: string
  }
) => void

schema

optional
schema?: StoreSchema<R, any>

storage

optional
storage?: TLSyncStorage<R>

Methods

onDataChange

optional

Deprecated: use the storage option with an onChange callback instead


Prev
TLPersistentClientSocket
Next
TLSyncForwardDiff