pinia-plugin-yjs
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

pinia-plugin-yjs

npm version npm downloads bundle JSDocs License

Example

import { createPinia } from 'pinia'
import * as Y from 'yjs'
import { WebrtcProvider } from 'y-webrtc'
import { createPiniaYJSPlugin } from 'pinia-plugin-yjs'

const ydoc = new Y.Doc()

const webrtcProvider = new WebrtcProvider('roomName', ydoc, { signaling: ['ws://localhost:4444'] })
const pinia = createPinia()

pinia.use(createPiniaYJSPlugin({ doc: ydoc }))

defineStore('todo', () => {
  // xxx
  return {
    // ...
  }
}, {
  // enable sharing
  sharing: true,
})

Thanks

License

MIT License © 2023-PRESENT croatialu

Package Sidebar

Install

npm i pinia-plugin-yjs

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

102 kB

Total Files

9

Last publish

Collaborators

  • wuli.croatia