Page MenuHomeSealhub

registry.ts
No OneTemporary

registry.ts

import { Component, ComponentConstructor } from "./component";
export class Registry {
map: Map<string, Component> = new Map();
add(type: string, component: ComponentConstructor<any>) {
this.map.set(type, new component());
}
get(type: string): Component | null {
const ret = this.map.get(type);
return ret ? ret : null;
}
getAll(): Record<string, Component> {
return Object.fromEntries(this.map.entries());
}
}

File Metadata

Mime Type
text/x-java
Expires
Sat, Nov 23, 02:50 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
547797
Default Alt Text
registry.ts (430 B)

Event Timeline