feat: initial registry class

This commit is contained in:
Ayo Ayco 2023-07-18 22:08:01 +02:00
parent c58b3aa152
commit 2eb5b89124

12
src/registry.ts Normal file
View file

@ -0,0 +1,12 @@
export class SerializedRegistry {
private _registeredIds: string[]
constructor() {}
get registeredIds() {
return this._registeredIds;
}
public register(id: string) {
if (this._registeredIds.includes(id))
throw Error(`${id} is already used`)
this._registeredIds.push(id);
}
}