From 9be256231be4c40e6f4342e6b8efc74c304e8458 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 23 May 2018 16:15:11 +0200 Subject: [PATCH] enable gc in demo --- examples/html-editor/index.mjs | 6 +++--- src/Connectors/WebsocketsConnector/server.mjs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/html-editor/index.mjs b/examples/html-editor/index.mjs index 34642bd5..855a9b77 100644 --- a/examples/html-editor/index.mjs +++ b/examples/html-editor/index.mjs @@ -3,10 +3,10 @@ import YWebsocketsConnector from '../../src/Connectors/WebsocketsConnector/Webso import Y from '../../src/Y.mjs' import DomBinding from '../../src/Bindings/DomBinding/DomBinding.mjs' import UndoManager from '../../src/Util/UndoManager.mjs' -import XmlFragment from '../../src/Types/YXml/YXmlFragment.mjs' +import YXmlFragment from '../../src/Types/YXml/YXmlFragment.mjs' const connector = new YWebsocketsConnector() -const y = new Y('html-editor') +const y = new Y('html-editor', null, null, { gc: true }) connector.connectY('html-editor', y) window.onload = function () { @@ -14,7 +14,7 @@ window.onload = function () { } window.y = y -window.yXmlType = y.define('xml', XmlFragment) +window.yXmlType = y.define('xml', YXmlFragment) window.undoManager = new UndoManager(window.yXmlType, { captureTimeout: 500 }) diff --git a/src/Connectors/WebsocketsConnector/server.mjs b/src/Connectors/WebsocketsConnector/server.mjs index 0d0b7e4b..9e230394 100644 --- a/src/Connectors/WebsocketsConnector/server.mjs +++ b/src/Connectors/WebsocketsConnector/server.mjs @@ -48,7 +48,7 @@ const wsConnector = { getRoom: function getRoom (roomName) { let room = rooms.get(roomName) if (room === undefined) { - const y = new Y(roomName) + const y = new Y(roomName, null, null, { gc: true }) y.on('afterTransaction', (y, transaction) => { if (transaction.encodedStructsLen > 0) { const encoder = new BinaryEncoder()