MCPcopy Create free account
hub / github.com/Fiddle-Digital/string-scroll / on

Method on

src/EventManager.ts:3–8  ·  view source on GitHub ↗
(id: string, event: Function)

Source from the content-addressed store, hash-verified

1export class EventManager{
2 private events: Map<string, Array<Function>> = new Map<string, Array<Function>>()
3 on(id: string, event: Function){
4 if ( this.events.has(id) == false) {
5 this.events.set(id, [])
6 }
7 this.events.get(id)?.push(event)
8 }
9 public has(id: string) {
10 return this.events.has(id)
11 }

Callers

nothing calls this directly

Calls 2

hasMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected