Skip to content
Snippets Groups Projects
app.js 367 B
Newer Older
  • Learn to ignore specific revisions
  • const Y = require("yjs")
    require("y-memory")(Y)
    require("y-array")(Y)
    require("y-text")(Y)
    require("./y-webrtc")(Y)
    
    Y({
      db: {
        name: "memory"
      },
      connector: {
        name: "webrtc",
        host: "localhost",
        port: 3000,
        path: "/api"
      },
      share: {
        textfield: "Text"
      }
    }).then(y => {
      y.share.textfield.bind(document.getElementById("textfield"))
    })