persistence updates + make Persistence.init async

This commit is contained in:
Kevin Jahns
2018-01-16 16:13:47 +01:00
parent c8f0cf5556
commit 0b510b64a3
5 changed files with 34 additions and 36 deletions

View File

@@ -4,14 +4,14 @@ window.onload = function () {
window.yXmlType.bindToDom(document.body)
}
let persistence = null // new Y.IndexedDBPersistence()
const persistence = new Y.IndexedDB()
// initialize a shared object. This function call returns a promise!
let y = new Y({
let y = new Y('htmleditor', {
connector: {
name: 'websockets-client',
url: 'http://127.0.0.1:1234',
room: 'x'
room: 'html-editor'
// maxBufferLength: 100
}
}, persistence)