❯ ~/robonen/tools
core
  • stdlibapi
  • platformapi
  • fetchapi
  • encodingapi
  • crdtapi
vue
  • vueapi
  • writekitapi
    ❯
    guide
    • Introduction
    • Playground
    • ❯addMark
    • ❯applyInputRule
    • ❯chainCommands
    • ❯convertBlock
    • ❯defaultTextType
    • ❯deleteSelection
    • ❯deleteSelectionInto
    • ❯duplicateBlock
    • ❯ensureNotEmpty
    • ❯exitAtom
    • ❯focusBlock
    • ❯indentListItem
    • ❯insertBlockBeside
    • ❯insertHardBreak
    • ❯insertSliceAt
    • ❯isBlockActive
    • ❯isMarkActive
    • ❯isTextBlockType
    • ❯joinBackward
    • ❯joinForward
    • ❯landingAfter
    • ❯moveBlockDown
    • ❯moveBlocks
    • ❯moveBlockUp
    • ❯outdentListItem
    • ❯removeBlock
    • ❯removeMark
    • ❯replaceSelection
    • ❯selectAll
    • ❯selectionBlockId
    • ❯setBlockType
    • ❯splitBlock
    • ❯toggleBlockType
    • ❯toggleChecked
    • ❯toggleMark
  • primitivesui
configs
  • eslintguide
  • tsconfigguide
  • tsdownguide
infra
  • renovateguide
@robonen/writekit/chainCommands
fn

chainCommands

tested

Combine commands into one that runs them in order and stops at the first that applies (returns true). The standard way to bind several fallbacks to a key.

Source Tests

Signature

ts
export function chainCommands(...commands: readonly Command[]): Command{ ... }

Parameters

ParameterTypeDefaultDescription
commands?readonly Command[]——

Returns

Command
on this page
  • Signature
  • Parameters
  • Returns