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