puppeteer/vendor/mitt/dist/mitt.modern.js
2020-07-29 12:11:40 +01:00

3 lines
296 B
JavaScript

export default function(e){return{all:e=e||new Map,on(t,n){const s=e.get(t);s&&s.push(n)||e.set(t,[n])},off(t,n){const s=e.get(t);s&&s.splice(s.indexOf(n)>>>0,1)},emit(t,n){(e.get(t)||[]).slice().map(e=>{e(n)}),(e.get("*")||[]).slice().map(e=>{e(t,n)})}}}
//# sourceMappingURL=mitt.modern.js.map