carbon-components
Version:
The Carbon Design System is IBM’s open-source design system for products and experiences.
17 lines (15 loc) • 367 B
JavaScript
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
export default function on(element, ...args) {
element.addEventListener(...args);
return {
release() {
element.removeEventListener(...args);
return null;
},
};
}