mirror of
https://github.com/sst/opencode.git
synced 2025-07-07 16:14:59 +00:00
fix lazy loading
This commit is contained in:
parent
8bbbc07aff
commit
fa35407572
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue