oberknecht-emitters
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -14,4 +14,4 @@ import { oberknechtActionEmitterOptions } from "../types/oberknecht.action.emitter.options"; | ||
emitreject: (eventName: string, args: any) => any; | ||
once: (eventName: string, fn: Function, args?: any, expectedEventName?: boolean, customDelay?: number, sendAsync?: boolean) => Promise<void>; | ||
once: (eventName: string, fn: Function, args?: any, expectedEventName?: boolean | Function, customDelay?: number, sendAsync?: boolean) => Promise<void>; | ||
next: (sym: string) => void; | ||
} |
@@ -39,3 +39,10 @@ "use strict"; | ||
!e.timedOut && | ||
(e.expectedEventName ?? e.eventName).toUpperCase() === eventName); | ||
(!e.expectedEventName || typeof e.expectedEventName !== "function" | ||
? (e.expectedEventName ?? e.eventName).toUpperCase() === eventName | ||
: e.expectedEventName({ | ||
response: { | ||
eventName: eventName, | ||
args: args, | ||
}, | ||
}))); | ||
}); | ||
@@ -42,0 +49,0 @@ let event = events[0]; |
@@ -1,3 +0,3 @@ | ||
export type oberknechtActionEmitterOptions = { | ||
export declare type oberknechtActionEmitterOptions = { | ||
"useExpectedEventNames"?: boolean; | ||
}; |
@@ -1,4 +0,4 @@ | ||
export type oberknechtEmitterOptions = { | ||
export declare type oberknechtEmitterOptions = { | ||
withNames?: boolean | string[]; | ||
withAllNames?: boolean | string[]; | ||
}; |
@@ -50,3 +50,10 @@ import { | ||
!e.timedOut && | ||
(e.expectedEventName ?? e.eventName).toUpperCase() === eventName | ||
(!e.expectedEventName || typeof e.expectedEventName !== "function" | ||
? (e.expectedEventName ?? e.eventName).toUpperCase() === eventName | ||
: e.expectedEventName({ | ||
response: { | ||
eventName: eventName, | ||
args: args, | ||
}, | ||
})) | ||
); | ||
@@ -92,3 +99,3 @@ }); | ||
args?: any, | ||
expectedEventName?: boolean, | ||
expectedEventName?: boolean | Function, | ||
customDelay?: number, | ||
@@ -95,0 +102,0 @@ sendAsync?: boolean |
{ | ||
"name": "oberknecht-emitters", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "export", |
41306
672