fn

applyTransaction

tested

Produce the next writekit state from a transaction. Stored marks are kept when explicitly set, cleared on any content change, and otherwise preserved.

Signature

ts
export function applyTransaction(state: WritekitState, tr: Transaction): WritekitState{ ... }

Parameters

ParameterTypeDescription
stateWritekitState
trTransaction

Returns

WritekitState
PropertyTypeDescription
docWritekitDocument
selectionSelection
schemaSchema
registryRegistry
storedMarksMarks | nullMarks to apply to the next typed character (toggle-before-type).