Closed Tahseenm closed 7 years ago
Hi Kent, Thanks for the awesome course! Helped me a lot moving from Gulp. Just noticed $on(elem, type, cb, { once: true }) would not work as expected.
Future proof version :+1:
/** * Wrapper for `addEventListener` * * @param {HTMLElement} target * @param {string} eventType * @param {function} eventHandler * @param {boolean|Object.<boolean>} options - useCapture OR * {capture, once, passive} */ function $on(target, eventType, eventHandler, opt = false) { target.addEventListener(eventType, eventHandler, opt); }
Thanks for the feedback! Normally I'd invite you to contribute by making a PR, but due to the unique nature of this project and all the lesson/step branches, it's pretty difficult to make changes. Thanks though!
Hi Kent, Thanks for the awesome course! Helped me a lot moving from Gulp. Just noticed $on(elem, type, cb, { once: true }) would not work as expected.
Future proof version :+1: