feat: implement lazy singleton pattern for repository instances and update related imports
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
export function createLazySingleton<T>(factory: () => T): () => T {
|
||||
let instance: T | null = null;
|
||||
return () => {
|
||||
instance ??= factory();
|
||||
return instance;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user