[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Function](https://evolu.dev/docs/api-reference/common/Function) › lazy

```ts
function lazy<T>(value: T): Lazy<T>;
```

Defined in: [packages/common/src/Function.ts:159](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Function.ts#L159)

Creates a [Lazy](https://evolu.dev/docs/api-reference/common/Function/type-aliases/Lazy) from a precomputed value.

Use when the value is expensive to compute and want to compute it once at
definition time rather than on every call.

### Example

```ts
// Computed once at definition, returned on every call
const getConfig = lazy(parseConfig(rawConfig));

// vs. computed on every call
const getConfig = () => parseConfig(rawConfig);
```