src/store/internals/addEnabledElement.js
function _repeatGlobalToolHistory(enabledElement) {
  if (!store.modules.globalConfiguration.state.globalToolSyncEnabled) {
    return;
  }

  const setToolModeFns = {
    active: setToolActiveForElement,
    passive: setToolPassiveForElement,
    enabled: setToolEnabledForElement,
    disabled: setToolDisabledForElement,
  };

  store.state.globalToolChangeHistory.forEach(historyEvent => {
    const args = historyEvent.args.slice(0);

    args.unshift(enabledElement);
    setToolModeFns[historyEvent.mode].apply(null, args);
  });
}
function _repeatGlobalToolHistory(enabledElement) {
  if (!store.modules.globalConfiguration.state.globalToolSyncEnabled) {
    return;
  }

  const setToolModeFns = {
    active: setToolActiveForElement,
    passive: setToolPassiveForElement,
    enabled: setToolEnabledForElement,
    disabled: setToolDisabledForElement,
  };

  store.state.globalToolChangeHistory.forEach(historyEvent => {
    const args = historyEvent.args.slice(0);

    args.unshift(enabledElement);
    setToolModeFns[historyEvent.mode].apply(null, args);
  });
}
function _repeatGlobalToolHistory ( enabledElement ) { if ( ! store . modules . globalConfiguration . state . globalToolSyncEnabled ) { return ; } const setToolModeFns = { active : setToolActiveForElement , passive : setToolPassiveForElement , enabled : setToolEnabledForElement , disabled : setToolDisabledForElement , } ; store . state . globalToolChangeHistory . forEach ( historyEvent => { const args = historyEvent . args . slice ( 0 ) ; args . unshift ( enabledElement ) ; setToolModeFns [ historyEvent . mode ] . apply ( null , args ) ; } ) ; }
Iterate over the globalToolChangeHistory and apply each `historyEvent`
to the supplied `enabledElement`.
@private
@method
@param {HTMLElement} enabledElement
@returns {void}
Iterate over the globalToolChangeHistory and apply each historyEvent to the supplied enabledElement .