mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-22 07:46:17 -04:00
17 lines
No EOL
487 B
JavaScript
17 lines
No EOL
487 B
JavaScript
// Selector shortcuts
|
|
const $ = query => document.getElementById(query);
|
|
const $$ = query => document.querySelector(query);
|
|
|
|
class Events {
|
|
static fire(type, detail = {}) {
|
|
window.dispatchEvent(new CustomEvent(type, { detail: detail }));
|
|
}
|
|
|
|
static on(type, callback, options) {
|
|
return window.addEventListener(type, callback, options);
|
|
}
|
|
|
|
static off(type, callback, options) {
|
|
return window.removeEventListener(type, callback, options);
|
|
}
|
|
} |