vue-crdt
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Vue CRDT

Minzip Version Downloads Issues License

📦 Install

npm i vue-crdt

🦄 Usage

import { reactive, ref } from 'vue'
import { defineStore, useHistory } from 'vue-crdt'

const useEditorStore = defineStore(doc => {
  // use y-webrtc
  //
  // new WebrtcProvider(
  //  'your-room-name',
  //  doc,
  //  { password: 'optional-room-password' },
  // )

  return {
    workspace: reactive({
      pages: { a: 'b' },
      activePage: null,
    }),
    width: ref(800),
    height: ref(600),
  }
})

const { workspace, width, height } = useEditorStore()

const history = useHistory(workspace)

workspace.activePage = 123
history.stopCapturing()
workspace.activePage = 456
history.undo()

console.log(workspace)

Package Sidebar

Install

npm i vue-crdt

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

12.8 kB

Total Files

12

Last publish

Collaborators

  • wengxiangmin