feat: garbage cursors on client

This commit is contained in:
cudr
2019-10-27 15:43:12 +03:00
parent 6ec91963c6
commit 8d7a10be1b
5 changed files with 45 additions and 11 deletions

View File

@@ -16,7 +16,7 @@ class Connection {
private options: ConnectionOptions
constructor(options: ConnectionOptions = defaultOptions) {
this.io = io(options.port, options.connectOpts)
this.io = io(options.entry, options.connectOpts)
this.docSet = new Automerge.DocSet()
this.connections = {}
this.options = merge(defaultOptions, options)

View File

@@ -1,7 +1,8 @@
import { ValueJSON } from 'slate'
import { Server } from 'http'
export interface ConnectionOptions {
port: number
entry: number | Server
connectOpts?: SocketIO.ServerOptions
defaultValue?: ValueJSON
saveTreshold?: number

View File

@@ -6,7 +6,7 @@ export const getClients = (io, nsp) =>
})
export const defaultOptions = {
port: 9000,
entry: 9000,
saveTreshold: 2000,
cursorAnnotationType: 'collaborative_selection'
}