mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge branch 'master'
This commit is contained in:
5
nativescript-core/utils/lazy.ts
Normal file
5
nativescript-core/utils/lazy.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export default function lazy<T>(action: () => T): () => T {
|
||||
let _value: T;
|
||||
|
||||
return () => _value || (_value = action());
|
||||
}
|
||||
Reference in New Issue
Block a user