Skip to content

Commit d0b48e9

Browse files
authored
Simplify handler
Simplify Handler type since eventName can be a string
1 parent 5a6deec commit d0b48e9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

types/index.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ export class Engine {
5151
removeFact(factOrId: string | Fact): boolean;
5252
getFact<T>(factId: string): Fact<T>;
5353

54-
on(eventName: "success", handler: EventHandler): this;
55-
on(eventName: "failure", handler: EventHandler): this;
56-
on<T>(eventName: string, handler: EventHandler<T>): this;
54+
on<T = Event>(eventName: string, handler: EventHandler<T>): this;
5755

5856
run(facts?: Record<string, any>, runOptions?: RunOptions): Promise<EngineResult>;
5957
stop(): this;

0 commit comments

Comments
 (0)