1
0
mirror of https://github.com/robonen/tools.git synced 2026-03-20 19:04:46 +00:00

feat(packages): add version jsdoc tags

This commit is contained in:
2024-09-30 06:20:45 +07:00
parent 975ca98f9a
commit 469ef8cdc2
7 changed files with 43 additions and 13 deletions

View File

@@ -3,6 +3,8 @@ export type EventsRecord = Record<string, Subscriber>;
/**
* Simple PubSub implementation
*
* @since 0.0.2
*
* @template {EventsRecord} Events
*/
@@ -85,7 +87,7 @@ export class PubSub<Events extends EventsRecord> {
* @param {...Parameters<Events[K]>} args Arguments for the listener
* @returns {boolean}
*/
public emit<K extends keyof Events>(event: K, ...args: Parameters<Events[K]>): boolean {
public emit<K extends keyof Events>(event: K, ...args: Parameters<Events[K]>) {
const listeners = this.events.get(event);
if (!listeners)