Socket
Book a DemoInstallSign in
Socket

pinia-plugin-yjs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pinia-plugin-yjs

pinia plugin that enables sharing of state between clients via Yjs

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
3
-25%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

yjs

FAQs

Package last updated on 21 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts