yjs/examples/textarea/index.js
2018-01-29 11:55:28 -08:00

16 lines
349 B
JavaScript

/* global Y */
let y = new Y('textarea-example', {
connector: {
name: 'websockets-client',
url: 'http://127.0.0.1:1234'
}
})
window.yTextarea = y
// bind the textarea to a shared text element
let type = y.define('textarea', Y.Text)
let textarea = document.querySelector('textarea')
let binding = new Y.TextareaBinding(type, textarea)