Following tutorial to set up remix app
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
export const singleton = <Value>(
|
||||
name: string,
|
||||
valueFactory: () => Value
|
||||
): Value => {
|
||||
const g = global as any;
|
||||
g.__singletons ??= {};
|
||||
g.__singletons[name] ??= valueFactory();
|
||||
return g.__singletons[name];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user