(name: string, getValue: () => T)
| 1 | export function singleton<T>(name: string, getValue: () => T): T { |
| 2 | const thusly = globalThis as any; |
| 3 | thusly.__trigger_singletons ??= {}; |
| 4 | thusly.__trigger_singletons[name] ??= getValue(); |
| 5 | return thusly.__trigger_singletons[name]; |
| 6 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…