fix(CssManager): Make CssManager a singleton and export the shared instance via getSingleton; update tests and dependencies
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@design.estate/dees-element',
|
||||
version: '2.1.2',
|
||||
version: '2.1.3',
|
||||
description: 'A library for creating custom elements extending the lit element class with additional functionalities.'
|
||||
}
|
||||
|
||||
@@ -9,6 +9,21 @@ export interface IBdVarTriplet {
|
||||
}
|
||||
|
||||
export class CssManager {
|
||||
// STATIC
|
||||
private static instance: CssManager | null = null;
|
||||
|
||||
/**
|
||||
* Returns the singleton instance of CssManager
|
||||
*/
|
||||
public static getSingleton(): CssManager {
|
||||
if (!CssManager.instance) {
|
||||
CssManager.instance = new CssManager();
|
||||
}
|
||||
return CssManager.instance;
|
||||
}
|
||||
|
||||
|
||||
// INSTANCE
|
||||
public domtoolsPromise = domtools.DomTools.setupDomTools();
|
||||
public goBright: boolean = false;
|
||||
public bdVarTripletStore: IBdVarTriplet[] = [];
|
||||
|
||||
@@ -26,7 +26,7 @@ export { directives };
|
||||
/**
|
||||
* a singleton instance of CssManager
|
||||
*/
|
||||
export const cssManager = new CssManager();
|
||||
export const cssManager = CssManager.getSingleton();
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user