enable gc in demo
This commit is contained in:
parent
c122bdc750
commit
9be256231b
@ -3,10 +3,10 @@ import YWebsocketsConnector from '../../src/Connectors/WebsocketsConnector/Webso
|
|||||||
import Y from '../../src/Y.mjs'
|
import Y from '../../src/Y.mjs'
|
||||||
import DomBinding from '../../src/Bindings/DomBinding/DomBinding.mjs'
|
import DomBinding from '../../src/Bindings/DomBinding/DomBinding.mjs'
|
||||||
import UndoManager from '../../src/Util/UndoManager.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 connector = new YWebsocketsConnector()
|
||||||
const y = new Y('html-editor')
|
const y = new Y('html-editor', null, null, { gc: true })
|
||||||
connector.connectY('html-editor', y)
|
connector.connectY('html-editor', y)
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
@ -14,7 +14,7 @@ window.onload = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.y = y
|
window.y = y
|
||||||
window.yXmlType = y.define('xml', XmlFragment)
|
window.yXmlType = y.define('xml', YXmlFragment)
|
||||||
window.undoManager = new UndoManager(window.yXmlType, {
|
window.undoManager = new UndoManager(window.yXmlType, {
|
||||||
captureTimeout: 500
|
captureTimeout: 500
|
||||||
})
|
})
|
||||||
|
@ -48,7 +48,7 @@ const wsConnector = {
|
|||||||
getRoom: function getRoom (roomName) {
|
getRoom: function getRoom (roomName) {
|
||||||
let room = rooms.get(roomName)
|
let room = rooms.get(roomName)
|
||||||
if (room === undefined) {
|
if (room === undefined) {
|
||||||
const y = new Y(roomName)
|
const y = new Y(roomName, null, null, { gc: true })
|
||||||
y.on('afterTransaction', (y, transaction) => {
|
y.on('afterTransaction', (y, transaction) => {
|
||||||
if (transaction.encodedStructsLen > 0) {
|
if (transaction.encodedStructsLen > 0) {
|
||||||
const encoder = new BinaryEncoder()
|
const encoder = new BinaryEncoder()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user