How to use the yjs/dist/y function in yjs

To help you get started, we’ve selected a few yjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sambapos / pmpos3 / src / store / configureProtocol.ts View on Github external
Swarm: [
                    '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star'
                ]
            }
        }
    });

    ipfs.once('ready', () => {
        ipfs.id((err, info) => {
            if (err) {
                throw err;
            }
        });
    });

    Y({
        db: {
            name: 'indexeddb'
        },
        connector: {
            name: 'ipfs',
            room: 'pmpos-protocol',
            ipfs: ipfs
        },
        share: {
            chat: 'Array',
            commits: 'Array'
        }
    }).then((y) => {
        dispatchCommitProtocol(dispatch, y.share.commits);

        dispatchCommitEvent(dispatch, y.share.commits.toArray());