Skip to content

Commit

Permalink
build: update to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
overflowz committed Dec 27, 2020
1 parent 898530b commit 73e744d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion dist/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ class DomainEvents {
let handlerMiddlewares = [];
let returnEvent = event;
let isExitEarly = false;
const exitEarlyCallback = () => void (isExitEarly = true);
const exitEarlyCallback = (event) => {
isExitEarly = true;
returnEvent = event !== null && event !== void 0 ? event : returnEvent;
};
try {
if (returnEvent.status === interface_1.EventStatus.COMPLETED) {
return returnEvent;
Expand Down
8 changes: 4 additions & 4 deletions dist/interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ export declare type GenerateDomainEventArgs<T extends IDomainEvent> = DeepReadon
export declare type GenerateDomainEventReturnType<T extends IDomainEvent> = IDomainEvent<T['params'], T['state']> & Pick<T, 'action' | 'metadata'>;
export declare type Middleware<T> = {
/** executed before event handler */
before?: (event: T, exit: () => void) => void | T | Promise<void | T>;
before?: (event: T, exit: (event?: T) => void) => void | T | Promise<void | T>;
/** executed after event handler */
after?: (event: T, exit: () => void) => void | T | Promise<void | T>;
after?: (event: T, exit: (event?: T) => void) => void | T | Promise<void | T>;
/** executed before each phase */
beforeEach?: (event: T, children: readonly IDomainEvent[], phase: EventPhase, exit: () => void) => void | T | Promise<void | T>;
beforeEach?: (event: T, children: readonly IDomainEvent[], phase: EventPhase, exit: (event?: T) => void) => void | T | Promise<void | T>;
/** executed after each phase */
afterEach?: (event: T, children: readonly IDomainEvent[], phase: EventPhase, exit: () => void) => void | T | Promise<void | T>;
afterEach?: (event: T, children: readonly IDomainEvent[], phase: EventPhase, exit: (event?: T) => void) => void | T | Promise<void | T>;
};
export declare type HandlerMapRecord<T extends IDomainEvent> = {
handler: IDomainEventHandler<T>;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@overflowz/de",
"version": "2.1.0-rc",
"version": "2.1.1-rc",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 73e744d

Please sign in to comment.