@piggly/event-bus
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -1,2 +0,2 @@ | ||
import EventDispatcher from '../EventDispatcher'; | ||
import { EventDispatcher } from '../EventDispatcher'; | ||
import { EventDriverInterface } from '../types'; | ||
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export default class LocalEventDriver implements EventDriverInterface { | ||
export declare class LocalEventDriver implements EventDriverInterface { | ||
/** | ||
@@ -10,0 +10,0 @@ * Driver name. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LocalEventDriver = void 0; | ||
/** | ||
@@ -98,3 +99,3 @@ * @file Local event driver using map for dispatchers. | ||
} | ||
exports.default = LocalEventDriver; | ||
exports.LocalEventDriver = LocalEventDriver; | ||
//# sourceMappingURL=LocalEventDriver.js.map |
@@ -1,2 +0,2 @@ | ||
import EventPayload from './EventPayload'; | ||
import { EventPayload } from './EventPayload'; | ||
import { EventBusOptions, EventDispatcherResponse, EventDriverInterface, EventHandler } from './types'; | ||
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export default class EventBus { | ||
export declare class EventBus { | ||
/** | ||
@@ -10,0 +10,0 @@ * Singleton instance. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const EventDispatcher_1 = tslib_1.__importDefault(require("./EventDispatcher")); | ||
const LocalEventDriver_1 = tslib_1.__importDefault(require("./drivers/LocalEventDriver")); | ||
exports.EventBus = void 0; | ||
const EventDispatcher_1 = require("./EventDispatcher"); | ||
const LocalEventDriver_1 = require("./drivers/LocalEventDriver"); | ||
/** | ||
@@ -43,3 +43,3 @@ * @file Event bus to subscribe, unsubscribe and publish events. | ||
this._drivers = new Map(); | ||
this.register(new LocalEventDriver_1.default()); | ||
this.register(new LocalEventDriver_1.LocalEventDriver()); | ||
} | ||
@@ -110,3 +110,3 @@ /** | ||
if (dispatcher === undefined) { | ||
dispatcher = new EventDispatcher_1.default(event_name); | ||
dispatcher = new EventDispatcher_1.EventDispatcher(event_name); | ||
driver.set(event_name, dispatcher); | ||
@@ -176,3 +176,3 @@ } | ||
} | ||
exports.default = EventBus; | ||
exports.EventBus = EventBus; | ||
//# sourceMappingURL=EventBus.js.map |
@@ -1,2 +0,2 @@ | ||
import EventPayload from './EventPayload'; | ||
import { EventPayload } from './EventPayload'; | ||
import type { EventDispatcherResponse, EventHandler } from './types'; | ||
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export default class EventDispatcher { | ||
export declare class EventDispatcher { | ||
/** | ||
@@ -10,0 +10,0 @@ * Handlers. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EventDispatcher = void 0; | ||
/** | ||
@@ -123,3 +124,3 @@ * @file Event dispatcher, where you can register handlers to an unique event and dispatch to them. | ||
} | ||
exports.default = EventDispatcher; | ||
exports.EventDispatcher = EventDispatcher; | ||
//# sourceMappingURL=EventDispatcher.js.map |
/** | ||
* Event payload with data. | ||
*/ | ||
export default class EventPayload<EventData extends Record<string, any> = Record<string, any>> { | ||
export declare class EventPayload<EventData extends Record<string, any> = Record<string, any>> { | ||
/** | ||
@@ -6,0 +6,0 @@ * Event id. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EventPayload = void 0; | ||
const uuid_1 = require("uuid"); | ||
@@ -83,3 +84,3 @@ /** | ||
} | ||
exports.default = EventPayload; | ||
exports.EventPayload = EventPayload; | ||
//# sourceMappingURL=EventPayload.js.map |
@@ -1,4 +0,3 @@ | ||
export { default as EventPayload } from './EventPayload'; | ||
export { default as EventDispatcher } from './EventDispatcher'; | ||
export { default as LocalEventDriver } from './drivers/LocalEventDriver'; | ||
export * from './types'; | ||
export { EventPayload } from './EventPayload'; | ||
export { EventDispatcher } from './EventDispatcher'; | ||
export { LocalEventDriver } from './drivers/LocalEventDriver'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LocalEventDriver = exports.EventDispatcher = exports.EventPayload = void 0; | ||
const tslib_1 = require("tslib"); | ||
var EventPayload_1 = require("./EventPayload"); | ||
Object.defineProperty(exports, "EventPayload", { enumerable: true, get: function () { return tslib_1.__importDefault(EventPayload_1).default; } }); | ||
Object.defineProperty(exports, "EventPayload", { enumerable: true, get: function () { return EventPayload_1.EventPayload; } }); | ||
var EventDispatcher_1 = require("./EventDispatcher"); | ||
Object.defineProperty(exports, "EventDispatcher", { enumerable: true, get: function () { return tslib_1.__importDefault(EventDispatcher_1).default; } }); | ||
Object.defineProperty(exports, "EventDispatcher", { enumerable: true, get: function () { return EventDispatcher_1.EventDispatcher; } }); | ||
var LocalEventDriver_1 = require("./drivers/LocalEventDriver"); | ||
Object.defineProperty(exports, "LocalEventDriver", { enumerable: true, get: function () { return tslib_1.__importDefault(LocalEventDriver_1).default; } }); | ||
tslib_1.__exportStar(require("./types"), exports); | ||
Object.defineProperty(exports, "LocalEventDriver", { enumerable: true, get: function () { return LocalEventDriver_1.LocalEventDriver; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,3 @@ | ||
import type EventDispatcher from '../EventDispatcher'; | ||
import type EventPayload from '../EventPayload'; | ||
import type { EventDispatcher } from '../EventDispatcher'; | ||
import type { EventPayload } from '../EventPayload'; | ||
export interface EventDriverInterface { | ||
@@ -4,0 +4,0 @@ readonly name: string; |
@@ -1,2 +0,2 @@ | ||
import EventBus from './core/EventBus'; | ||
import { EventBus } from './core/EventBus'; | ||
/** | ||
@@ -11,3 +11,5 @@ * Event bus library. | ||
*/ | ||
export * from './core'; | ||
export { EventPayload, EventDispatcher, LocalEventDriver } from './core'; | ||
export type { EventDriverInterface, EventBusOptions, EventDispatcherResponse, EventHandlerCallback, AsyncEventHandlerCallback, EventHandler, } from './core/types'; | ||
export { EventBus }; | ||
export default EventBus; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const EventBus_1 = tslib_1.__importDefault(require("./core/EventBus")); | ||
exports.EventBus = exports.LocalEventDriver = exports.EventDispatcher = exports.EventPayload = void 0; | ||
const EventBus_1 = require("./core/EventBus"); | ||
Object.defineProperty(exports, "EventBus", { enumerable: true, get: function () { return EventBus_1.EventBus; } }); | ||
/** | ||
@@ -14,4 +15,7 @@ * Event bus library. | ||
*/ | ||
tslib_1.__exportStar(require("./core"), exports); | ||
exports.default = EventBus_1.default; | ||
var core_1 = require("./core"); | ||
Object.defineProperty(exports, "EventPayload", { enumerable: true, get: function () { return core_1.EventPayload; } }); | ||
Object.defineProperty(exports, "EventDispatcher", { enumerable: true, get: function () { return core_1.EventDispatcher; } }); | ||
Object.defineProperty(exports, "LocalEventDriver", { enumerable: true, get: function () { return core_1.LocalEventDriver; } }); | ||
exports.default = EventBus_1.EventBus; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import EventDispatcher from '../EventDispatcher'; | ||
import { EventDispatcher } from '../EventDispatcher'; | ||
import { EventDriverInterface } from '../types'; | ||
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export default class LocalEventDriver implements EventDriverInterface { | ||
export declare class LocalEventDriver implements EventDriverInterface { | ||
/** | ||
@@ -10,0 +10,0 @@ * Driver name. |
@@ -5,3 +5,3 @@ /** | ||
*/ | ||
export default class LocalEventDriver { | ||
export class LocalEventDriver { | ||
/** | ||
@@ -8,0 +8,0 @@ * Driver name. |
@@ -1,2 +0,2 @@ | ||
import EventPayload from './EventPayload'; | ||
import { EventPayload } from './EventPayload'; | ||
import { EventBusOptions, EventDispatcherResponse, EventDriverInterface, EventHandler } from './types'; | ||
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export default class EventBus { | ||
export declare class EventBus { | ||
/** | ||
@@ -10,0 +10,0 @@ * Singleton instance. |
@@ -1,3 +0,3 @@ | ||
import EventDispatcher from './EventDispatcher'; | ||
import LocalEventDriver from './drivers/LocalEventDriver'; | ||
import { EventDispatcher } from './EventDispatcher'; | ||
import { LocalEventDriver } from './drivers/LocalEventDriver'; | ||
/** | ||
@@ -7,3 +7,3 @@ * @file Event bus to subscribe, unsubscribe and publish events. | ||
*/ | ||
export default class EventBus { | ||
export class EventBus { | ||
/** | ||
@@ -10,0 +10,0 @@ * Singleton instance. |
@@ -1,2 +0,2 @@ | ||
import EventPayload from './EventPayload'; | ||
import { EventPayload } from './EventPayload'; | ||
import type { EventDispatcherResponse, EventHandler } from './types'; | ||
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export default class EventDispatcher { | ||
export declare class EventDispatcher { | ||
/** | ||
@@ -10,0 +10,0 @@ * Handlers. |
@@ -5,3 +5,3 @@ /** | ||
*/ | ||
export default class EventDispatcher { | ||
export class EventDispatcher { | ||
/** | ||
@@ -8,0 +8,0 @@ * Handlers. |
/** | ||
* Event payload with data. | ||
*/ | ||
export default class EventPayload<EventData extends Record<string, any> = Record<string, any>> { | ||
export declare class EventPayload<EventData extends Record<string, any> = Record<string, any>> { | ||
/** | ||
@@ -6,0 +6,0 @@ * Event id. |
@@ -5,3 +5,3 @@ import { v4 as uuidv4 } from 'uuid'; | ||
*/ | ||
export default class EventPayload { | ||
export class EventPayload { | ||
/** | ||
@@ -8,0 +8,0 @@ * Event id. |
@@ -1,4 +0,3 @@ | ||
export { default as EventPayload } from './EventPayload'; | ||
export { default as EventDispatcher } from './EventDispatcher'; | ||
export { default as LocalEventDriver } from './drivers/LocalEventDriver'; | ||
export * from './types'; | ||
export { EventPayload } from './EventPayload'; | ||
export { EventDispatcher } from './EventDispatcher'; | ||
export { LocalEventDriver } from './drivers/LocalEventDriver'; |
@@ -1,5 +0,4 @@ | ||
export { default as EventPayload } from './EventPayload'; | ||
export { default as EventDispatcher } from './EventDispatcher'; | ||
export { default as LocalEventDriver } from './drivers/LocalEventDriver'; | ||
export * from './types'; | ||
export { EventPayload } from './EventPayload'; | ||
export { EventDispatcher } from './EventDispatcher'; | ||
export { LocalEventDriver } from './drivers/LocalEventDriver'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,3 @@ | ||
import type EventDispatcher from '../EventDispatcher'; | ||
import type EventPayload from '../EventPayload'; | ||
import type { EventDispatcher } from '../EventDispatcher'; | ||
import type { EventPayload } from '../EventPayload'; | ||
export interface EventDriverInterface { | ||
@@ -4,0 +4,0 @@ readonly name: string; |
@@ -1,2 +0,2 @@ | ||
import EventBus from './core/EventBus'; | ||
import { EventBus } from './core/EventBus'; | ||
/** | ||
@@ -11,3 +11,5 @@ * Event bus library. | ||
*/ | ||
export * from './core'; | ||
export { EventPayload, EventDispatcher, LocalEventDriver } from './core'; | ||
export type { EventDriverInterface, EventBusOptions, EventDispatcherResponse, EventHandlerCallback, AsyncEventHandlerCallback, EventHandler, } from './core/types'; | ||
export { EventBus }; | ||
export default EventBus; |
@@ -1,2 +0,2 @@ | ||
import EventBus from './core/EventBus'; | ||
import { EventBus } from './core/EventBus'; | ||
/** | ||
@@ -11,4 +11,5 @@ * Event bus library. | ||
*/ | ||
export * from './core'; | ||
export { EventPayload, EventDispatcher, LocalEventDriver } from './core'; | ||
export { EventBus }; | ||
export default EventBus; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@piggly/event-bus", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "An ESM/CommonJS library following Oriented-Object Programming pattern to manager an Event Bus.", | ||
@@ -55,22 +55,22 @@ "scripts": { | ||
"devDependencies": { | ||
"@types/jest": "^29.2.5", | ||
"@types/uuid": "^9.0.6", | ||
"@typescript-eslint/eslint-plugin": "^5.48.0", | ||
"@typescript-eslint/parser": "^5.48.0", | ||
"@types/jest": "^29.5.12", | ||
"@types/uuid": "^9.0.8", | ||
"@typescript-eslint/eslint-plugin": "^5.62.0", | ||
"@typescript-eslint/parser": "^5.62.0", | ||
"@zerollup/ts-transform-paths": "^1.7.18", | ||
"eslint": "^8.31.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-config-airbnb-typescript": "^17.0.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"eslint-config-airbnb-typescript": "^17.1.0", | ||
"eslint-config-prettier": "^8.10.0", | ||
"eslint-import-resolver-alias": "^1.1.2", | ||
"eslint-import-resolver-typescript": "^3.5.2", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-import-resolver-typescript": "^3.6.1", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"jest": "^29.3.1", | ||
"prettier": "^2.8.1", | ||
"ts-jest": "^29.0.3", | ||
"ts-node": "^10.9.1", | ||
"tsc-alias": "^1.8.6", | ||
"tslib": "^2.4.1", | ||
"typescript": "^4.9.4" | ||
"jest": "^29.7.0", | ||
"prettier": "^2.8.8", | ||
"ts-jest": "^29.1.4", | ||
"ts-node": "^10.9.2", | ||
"tsc-alias": "^1.8.10", | ||
"tslib": "^2.6.3", | ||
"typescript": "^4.9.5" | ||
}, | ||
@@ -77,0 +77,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
71599
1783