@thednp/event-listener
Advanced tools
Comparing version 1.0.1 to 1.0.2
/*! | ||
* EventListener v1.0.1 (https://github.com/thednp/event-listener.js) | ||
* EventListener v1.0.2 (https://github.com/thednp/event-listener) | ||
* Modern event listener for efficient applications based on subscribe-publish pattern. | ||
@@ -4,0 +4,0 @@ * Copyright 2022 © thednp |
@@ -1,2 +0,2 @@ | ||
// EventListener v1.0.1 | thednp © 2022 | MIT-License | ||
// EventListener v1.0.2 | thednp © 2022 | MIT-License | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).EventListener=t()}(this,(function(){"use strict";var e={};function t(t){var o=this,i=t.type,r=t.target;[].concat(e[i]).forEach((function(e){var s=e[0],a=e[1];[r,o].some((function(e){return s===e}))&&[].concat(a).forEach((function(e){var o=e[0],r=e[1];o.apply(s,[t]),r&&r.once&&n(s,i,o,r)}))}))}var n=function(n,o,i,r){var s=e[o],a=s&&s.get(n),f=a&&a.get(i),c=(void 0!==f?f:{options:r}).options;a&&a.has(i)&&a.delete(i),!s||a&&a.size||s.delete(n),s&&s.size||delete e[o],a&&a.size||n.removeEventListener(o,t,c)};return{on:function(n,o,i,r){e[o]||(e[o]=new Map);var s=e[o];s.has(n)||s.set(n,new Map);var a=s.get(n),f=a.size;a.set(i,r),f||n.addEventListener(o,t,r)},off:n,globalListener:t,registry:e}})); |
/*! | ||
* EventListener v1.0.1 (https://github.com/thednp/event-listener.js) | ||
* EventListener v1.0.2 (https://github.com/thednp/event-listener) | ||
* Modern event listener for efficient applications based on subscribe-publish pattern. | ||
@@ -4,0 +4,0 @@ * Copyright 2022 © thednp |
@@ -1,2 +0,2 @@ | ||
// EventListener v1.0.1 | thednp © 2022 | MIT-License | ||
// EventListener v1.0.2 | thednp © 2022 | MIT-License | ||
const e={};function t(t){const o=this,{type:n,target:i}=t;[...e[n]].forEach(e=>{const[a,c]=e;[i,o].some(e=>a===e)&&[...c].forEach(e=>{const[o,i]=e;o.apply(a,[t]),i&&i.once&&s(a,n,o,i)})})}const s=(s,o,n,i)=>{const a=e[o],c=a&&a.get(s),r=c&&c.get(n),{options:p}=void 0!==r?r:{options:i};c&&c.has(n)&&c.delete(n),!a||c&&c.size||a.delete(s),a&&a.size||delete e[o],c&&c.size||s.removeEventListener(o,t,p)},o={on:(s,o,n,i)=>{e[o]||(e[o]=new Map);const a=e[o];a.has(s)||a.set(s,new Map);const c=a.get(s),{size:r}=c;c.set(n,i),r||s.addEventListener(o,t,i)},off:s,globalListener:t,registry:e};export{o as default}; |
/*! | ||
* EventListener v1.0.1 (https://github.com/thednp/event-listener.js) | ||
* EventListener v1.0.2 (https://github.com/thednp/event-listener) | ||
* Modern event listener for efficient applications based on subscribe-publish pattern. | ||
@@ -4,0 +4,0 @@ * Copyright 2022 © thednp |
@@ -1,2 +0,2 @@ | ||
// EventListener v1.0.1 | thednp © 2022 | MIT-License | ||
// EventListener v1.0.2 | thednp © 2022 | MIT-License | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).EventListener=t()}(this,(function(){"use strict";const e={};function t(t){const o=this,{type:s,target:i}=t;[...e[s]].forEach(e=>{const[f,c]=e;[i,o].some(e=>f===e)&&[...c].forEach(e=>{const[o,i]=e;o.apply(f,[t]),i&&i.once&&n(f,s,o,i)})})}const n=(n,o,s,i)=>{const f=e[o],c=f&&f.get(n),d=c&&c.get(s),{options:r}=void 0!==d?d:{options:i};c&&c.has(s)&&c.delete(s),!f||c&&c.size||f.delete(n),f&&f.size||delete e[o],c&&c.size||n.removeEventListener(o,t,r)};return{on:(n,o,s,i)=>{e[o]||(e[o]=new Map);const f=e[o];f.has(n)||f.set(n,new Map);const c=f.get(n),{size:d}=c;c.set(s,i),d||n.addEventListener(o,t,i)},off:n,globalListener:t,registry:e}})); |
{ | ||
"name": "@thednp/event-listener", | ||
"author": "thednp", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Modern event listener for efficient applications based on subscribe-publish pattern.", | ||
"license": "MIT", | ||
"homepage": "https://github.com/thednp/event-listener.js", | ||
"homepage": "https://github.com/thednp/event-listener", | ||
"main": "dist/event-listener.min.js", | ||
@@ -14,6 +14,6 @@ "module": "dist/event-listener.esm.js", | ||
"type": "git", | ||
"url": "git+https://github.com/thednp/event-listener.js.git" | ||
"url": "git+https://github.com/thednp/event-listener.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/thednp/event-listener.js/issues" | ||
"url": "https://github.com/thednp/event-listener/issues" | ||
}, | ||
@@ -20,0 +20,0 @@ "keywords": [ |
27443