A Promise-based DOM event utility
npm install @degjs/dom-eventIf you're using NPM, you can install DomEvent with the following command:
```
$ npm install @degjs/dom-event
javascript
import domEvent from '@degjs/dom-event';const element = document.querySelector('.some-element');
/ Get a Promise for the transitionend event on an element /
const transitionPromise = domEvent(element, 'transitionend');
/ Get another Promise for some other asynchronous task, such as an API call /
const anotherPromise = someAsyncTask();
/ Perform some action when all promises succeed /
Promise.all([transitionPromise, anotherPromise])
.then(onSuccessFunction)
.catch(onErrorFunction);
`Parameters
#### el
Type:
Element
The DOM element that the DOM event will occur on.#### eventName
Type:
String` Breakpoints depends on the following browser APIs:
+ Promise
To support legacy browsers, you'll need to include polyfills for the above APIs.