DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:prosemirror:devel:transaction

ProseMirror Development

Transactions

Transactions happen at or with a certain Selection. Which can either be a TextSelection or a NodeSelection.

preliminary insights

It is possible to build a complex action from several subactions. I'm not sure if this is the correct/best-practice way to do it. FIXME

        dispatch(state.tr
            .ensureMarks([])
            .insertText(prefix)
            .insertText(username)
            .addMark(
                usernameFrom,
                usernameTo,
                schema.marks.link.create({
                    href: `mailto:${usermail}`,
                }))
            .insertText(timestring)
            .addMark(
                usernameFrom,
                signatureEnd,
                schema.marks.em.create())
            .ensureMarks([]));
plugin/prosemirror/devel/transaction.txt · Last modified: 2017-07-03 18:30 by grosse

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki