Add more improvements
This commit is contained in:
parent
e1c74a8054
commit
bc16bdd62e
1 changed files with 286 additions and 158 deletions
21
src/graphics/rendering/insights.ts
Normal file
21
src/graphics/rendering/insights.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
export class Insights {
|
||||
private static insights: any = {};
|
||||
|
||||
public static setValue(key: string | Array<string>, value: any): void {
|
||||
if (Array.isArray(key)) {
|
||||
key.reduce((previousValue, currentKey) => {
|
||||
if (!Object.prototype.hasOwnProperty.call(previousValue, currentKey)) {
|
||||
previousValue[currentKey] = {};
|
||||
}
|
||||
|
||||
return previousValue[currentKey];
|
||||
}, Insights.insights);
|
||||
} else {
|
||||
Insights.insights[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static get values(): any {
|
||||
return Insights.insights;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue