MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / lazy

Function lazy

packages/core/utils/lazy.ts:1–5  ·  view source on GitHub ↗
(action: () => T)

Source from the content-addressed store, hash-verified

1export default function lazy<T>(action: () => T): () => T {
2 let _value: T;
3
4 return () => _value || (_value = action());
5}

Calls 1

actionFunction · 0.50

Tested by

no test coverage detected