mirror of
https://fastgit.cc/https://github.com/anomalyco/opencode
synced 2026-04-21 13:21:17 +08:00
fix lazy loading
This commit is contained in:
@@ -4,6 +4,7 @@ export function lazy<T>(fn: () => T) {
|
||||
|
||||
return (): T => {
|
||||
if (loaded) return value as T
|
||||
loaded = true
|
||||
value = fn()
|
||||
return value as T
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user