document terriable function
This commit is contained in:
parent
86bb5411dd
commit
0a1d2cfd26
2 changed files with 8 additions and 0 deletions
|
@ -23,6 +23,10 @@ class SnowFlake {
|
|||
SnowFlake.FinalizationRegistry.register(this, [id, obj.constructor]);
|
||||
this.obj = obj;
|
||||
}
|
||||
/**
|
||||
* Just to clarify bc TS, it returns a SnowFlake\<type> which is what you entered with the type parameter
|
||||
*
|
||||
**/
|
||||
static getSnowFlakeFromID(id, type) {
|
||||
if (!SnowFlake.SnowFlakes.get(type)) {
|
||||
SnowFlake.SnowFlakes.set(type, new Map());
|
||||
|
|
|
@ -23,6 +23,10 @@ class SnowFlake<x>{
|
|||
SnowFlake.FinalizationRegistry.register(this,[id,obj.constructor]);
|
||||
this.obj=obj;
|
||||
}
|
||||
/**
|
||||
* Just to clarify bc TS, it returns a SnowFlake\<type> which is what you entered with the type parameter
|
||||
*
|
||||
**/
|
||||
static getSnowFlakeFromID<T extends {}>(id:string,type: abstract new(...args: never) => T): SnowFlake<T>{
|
||||
if(!SnowFlake.SnowFlakes.get(type)){
|
||||
SnowFlake.SnowFlakes.set(type,new Map());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue