How to use the yjs/dist/y.Array 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 / Blocks / index.ts View on Github external
): AppThunkAction => (dispatch, getState) => {
        let actionLog = getState().blocks.get('protocol').share.actionLog;

        let bid = blockId;
        if (type === 'CREATE_BLOCK') {
            bid = uuidv4();
            data = 'id:' + bid;
        }

        let actions = actionLog.get(bid);
        if (!actions) {
            actionLog.set(bid, Y.Array);
            actions = actionLog.get(bid);
        }
        actions.push([{
            id: uuidv4(),
            time: new Date().getTime(),
            user: getState().client.loggedInUser,
            blockId: bid,
            type: type,
            data: objectify(data)
        }]);
    },
    loadBlock: (blockId: string): AppThunkAction => (dispatch, getState) => {