@chasemoskal/magical
Version:
web toolkit for lit apps
13 lines • 444 B
JavaScript
export const ev = (Event) => ({
target: (target) => ({
dispatch(detail, options) {
target.dispatchEvent(new Event(Event.type, { ...options, detail }));
},
listen(listener, options) {
target.addEventListener(Event.type, listener, options);
return () => target
.removeEventListener(Event.type, listener, options);
},
})
});
//# sourceMappingURL=ev.js.map