Command Counts

Returns a number describing the count of a target trigger being pressed.

Syntax

function getTriggerCounts(state, trigger) {
  return state.command.triggerCounts.get(trigger, 0);
}

Parameters

trigger

The target trigger to retrieve the pressed count of. A full list of available command ids can be found here.

Examples

Returns the number of times the undo hotkey has been pressed.

getModifier(
  store.getState(),
  "triggers.undo"
)