Skip to content

Commit

Permalink
fix: data type
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Mar 30, 2023
1 parent 390e4d8 commit 7609f2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type Handler<T = unknown> = (data: T) => void;
export type HandlerCallback<R> = Handler<Channels[keyof Channels]>;

export interface Pubsub<T extends Record<string, unknown> = {}> {
data: Map<any, any>;
data: Map<keyof T, HandlerCallback<T>[]>;
on<_T extends keyof T>(key: _T, callback: HandlerCallback<T>): void;
to<_T extends keyof T>(key: _T, callback: T[_T]): void;
}

0 comments on commit 7609f2a

Please sign in to comment.