From 20c44d369fc24007f5e8a7aba7bf8fdb3e688612 Mon Sep 17 00:00:00 2001 From: cudr Date: Sat, 19 Oct 2019 23:14:49 +0300 Subject: [PATCH] feat: add users twice --- packages/backend/src/Connection.ts | 2 ++ packages/client/src/Connection.ts | 2 ++ packages/example/src/Room.tsx | 1 + 3 files changed, 5 insertions(+) diff --git a/packages/backend/src/Connection.ts b/packages/backend/src/Connection.ts index 0940434..241e85f 100644 --- a/packages/backend/src/Connection.ts +++ b/packages/backend/src/Connection.ts @@ -22,6 +22,8 @@ class Connection { this.options = merge(defaultOptions, options) this.configure() + + return this } private configure = () => diff --git a/packages/client/src/Connection.ts b/packages/client/src/Connection.ts index 503240a..708d5ab 100644 --- a/packages/client/src/Connection.ts +++ b/packages/client/src/Connection.ts @@ -50,6 +50,8 @@ class Connection { this.docSet = new Automerge.DocSet() this.connect() + + return this } sendData = (data: any) => { diff --git a/packages/example/src/Room.tsx b/packages/example/src/Room.tsx index a4c6623..1f1350e 100644 --- a/packages/example/src/Room.tsx +++ b/packages/example/src/Room.tsx @@ -31,6 +31,7 @@ class Room extends Component { componentDidMount() { this.addUser() + setTimeout(this.addUser, 10) } render() {