ts-simple-event-bus
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["ts-event-bus"]=t():e["ts-event-bus"]=t()}(self,(function(){return(()=>{"use strict";var e={225:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventBus=t.MessageTimeoutError=void 0;class s extends Error{constructor(e){super("Message timeout error"),this.message=`Message timeout error on message ${e}`}}t.MessageTimeoutError=s,t.EventBus=class{constructor(e){this.subcriptions=[],this.idGenerator=e}publish({queue:e,message:t,id:s}){this.subcriptions.forEach((r=>{r.queue===e&&r.callback(t,s)}))}subscribe(e){const t=this.idGenerator();return this.subcriptions.push(Object.assign(Object.assign({},e),{id:t})),{unsubscribe:()=>{this.subcriptions=this.subcriptions.filter((e=>e.id!==t))}}}publishAndWaitForResponse({message:e,queue:t,responseQueue:r,timeout:i=5e3}){return new Promise(((o,u)=>{const n=this.idGenerator(),c=setTimeout((()=>{u(new s)}),i);this.subscribe({queue:r,callback:(e,t)=>{t===n&&(clearTimeout(c),o(e))}}),this.publish({queue:t,message:e,id:n})}))}}},607:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||r(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),i(s(225),t)}},t={};return function s(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,s),o.exports}(607)})()})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["ts-event-bus"]=t():e["ts-event-bus"]=t()}(this,(function(){return(()=>{"use strict";var e={225:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventBus=t.MessageTimeoutError=void 0;class s extends Error{constructor(e){super("Message timeout error"),this.message=`Message timeout error on message ${e}`}}t.MessageTimeoutError=s,t.EventBus=class{constructor(e){this.subcriptions=[],this.idGenerator=e}publish({queue:e,message:t,id:s}){this.subcriptions.forEach((r=>{r.queue===e&&r.callback(t,s)}))}subscribe(e){const t=this.idGenerator();return this.subcriptions.push(Object.assign(Object.assign({},e),{id:t})),{unsubscribe:()=>{this.subcriptions=this.subcriptions.filter((e=>e.id!==t))}}}publishAndWaitForResponse({message:e,queue:t,responseQueue:r,timeout:i=5e3}){return new Promise(((o,u)=>{const n=this.idGenerator(),c=setTimeout((()=>{u(new s)}),i);this.subscribe({queue:r,callback:(e,t)=>{t===n&&(clearTimeout(c),o(e))}}),this.publish({queue:t,message:e,id:n})}))}}},607:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||r(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),i(s(225),t)}},t={};return function s(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,s),o.exports}(607)})()})); |
{ | ||
"name": "ts-simple-event-bus", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -11,3 +11,4 @@ const path = require('path'); | ||
library: "ts-event-bus", | ||
libraryTarget: 'umd' | ||
libraryTarget: 'umd', | ||
globalObject: "this", | ||
}, | ||
@@ -14,0 +15,0 @@ resolve: { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12057
237