UNPKG

easy-toggle-state

Version:

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time.

8 lines (7 loc) 252 B
/** * Dispatch hooks * @param {node} element - An element on which dispatch the hook * @param {string} action - An event to dispatch * @returns {boolean} - True or False */ export default (element, action) => element.dispatchEvent(action);