From 0a1d2cfd269744570f8984338f59e3c76ced92ca Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Thu, 25 Jul 2024 12:31:20 -0500 Subject: [PATCH] document terriable function --- .dist/snowflake.js | 4 ++++ webpage/snowflake.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.dist/snowflake.js b/.dist/snowflake.js index 3193371..a01ce89 100644 --- a/.dist/snowflake.js +++ b/.dist/snowflake.js @@ -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\ which is what you entered with the type parameter + * + **/ static getSnowFlakeFromID(id, type) { if (!SnowFlake.SnowFlakes.get(type)) { SnowFlake.SnowFlakes.set(type, new Map()); diff --git a/webpage/snowflake.ts b/webpage/snowflake.ts index 49bcc2b..2a9193d 100644 --- a/webpage/snowflake.ts +++ b/webpage/snowflake.ts @@ -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\ which is what you entered with the type parameter + * + **/ static getSnowFlakeFromID(id:string,type: abstract new(...args: never) => T): SnowFlake{ if(!SnowFlake.SnowFlakes.get(type)){ SnowFlake.SnowFlakes.set(type,new Map());